/* ==========================================================================
   Cambridge Roofing and Scaffolding — theme layer over Bootstrap 5.3.0-alpha3
   Loaded after bootstrap.min.css: overrides win via cascade order at equal
   specificity, so nothing here needs to out-specificity a utility class.

   Base (dark):   --bs-body-bg #14161A   --bs-body-color #ECEEF0
   Light sections:--bs-body-bg #F5F3EF   --bs-body-color #14161A  (white on --alt)
   Accent:        #F5A623 (signal amber — scaffold inspection-tag reference)
   Display:       'Big Shoulders'   Body: 'Inter'   Utility: 'IBM Plex Mono'
   ========================================================================== */

:root, [data-bs-theme="dark"] {
  --bs-body-bg: #14161A;
  --bs-body-color: #ECEEF0;
  --bs-secondary-color: #8B929B;
  --bs-tertiary-bg: #1B1E23;
  --bs-border-color: #2C3038;
  --bs-border-color-translucent: #2C3038;
  --bs-link-color: #F5A623;
  --bs-link-hover-color: #ffb646;
  --bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --accent: #F5A623;
  --accent-ink: #2A1D00;
  --font-display: 'Big Shoulders', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

[data-bs-theme="light"] {
  --bs-body-bg: #F5F3EF;
  --bs-body-color: #14161A;
  --bs-secondary-color: #5B6067;
  --bs-tertiary-bg: #FFFFFF;
  --bs-border-color: #E3E1DC;
  --bs-border-color-translucent: #E3E1DC;
  --bs-link-color: #B97A12;
  --bs-link-hover-color: #935f0c;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body { font-size: 1rem; line-height: 1.6; }
a { text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.05;
}
h1 { font-size: clamp(2.4rem, 5.5vw, 4.6rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); }
h3 { font-size: 1.15rem; text-transform: none; font-family: 'Inter', sans-serif; font-weight: 700; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9em;
}

/* ============ Buttons ============ */
/* Bootstrap's .btn already reads colour/size from --bs-btn-* custom props,
   so this just supplies our own palette on top of the base component. */
.btn {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 2px;
  padding: 0.7rem 1.4rem;
}
.btn-lg { font-size: 0.96rem; padding: 0.95rem 1.7rem; }

.btn-accent-cta {
  --bs-btn-color: var(--accent-ink);
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: var(--accent-ink);
  --bs-btn-hover-bg: #ffb646;
  --bs-btn-hover-border-color: #ffb646;
  --bs-btn-active-bg: #e0951a;
  --bs-btn-active-border-color: #e0951a;
  --bs-btn-font-weight: 700;
}

.btn-outline-light { --bs-btn-border-color: var(--bs-border-color); }
.btn-outline-dark { --bs-btn-color: var(--bs-body-color); --bs-btn-border-color: var(--bs-border-color); }

/* ============ Navbar / brand ============ */
/* No backdrop-filter here: it establishes a new containing block for any
   position:fixed descendant, which traps the offcanvas panel's fixed
   positioning inside the navbar's own height instead of the viewport - that
   was the cause of the mobile menu rendering as a tiny clipped box. */
.site-navbar {
  background: rgba(20, 22, 26, 0.96);
  border-bottom: 1px solid var(--bs-border-color);
}
.brand-mark-img { height: 36px; width: auto; }
.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
  line-height: 1.2;
}
.brand-text strong { color: var(--bs-body-color); font-weight: 800; font-size: 1.2rem; letter-spacing: 0.01em; display: block; }

.phone-link { font-family: var(--font-mono); font-size: 0.9rem; color: var(--bs-secondary-color); }
.phone-link:hover { color: var(--accent); }

.navbar-nav .nav-link {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--bs-body-color);
  padding: 0.6rem 0.9rem;
}
.navbar-nav .nav-link:hover { color: var(--accent); }

/* Belt-and-braces: set the dropdown component's own vars directly rather
   than relying on inheritance, since alpha-stage colour-mode support is
   inconsistent per-component. */
.dropdown-menu {
  --bs-dropdown-bg: var(--bs-tertiary-bg);
  --bs-dropdown-color: var(--bs-body-color);
  --bs-dropdown-link-color: var(--bs-body-color);
  --bs-dropdown-link-hover-color: var(--accent);
  --bs-dropdown-link-hover-bg: rgba(245, 166, 35, 0.08);
  --bs-dropdown-border-color: var(--bs-border-color);
}

/* ============ Sub-page header (services/scaffold-for/areas pages) ============ */
.page-header { padding: 4.5rem 0 4.5rem; border-bottom: 1px solid var(--bs-border-color); }
@media (max-width: 640px) {
  .page-header { padding: 3.5rem 0 3.5rem; }
}
.breadcrumb {
  --bs-breadcrumb-divider-color: var(--bs-secondary-color);
  --bs-breadcrumb-item-active-color: var(--bs-secondary-color);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--bs-secondary-color); }
.breadcrumb a:hover { color: var(--accent); }
/* Over the hero photo the muted grey loses legibility - lift it there only. */
.page-header .breadcrumb {
  --bs-breadcrumb-divider-color: #C3C8CD;
  --bs-breadcrumb-item-active-color: #C3C8CD;
  text-shadow: 0 1px 3px rgba(20, 22, 26, 0.55);
}
.page-header .breadcrumb a { color: #C3C8CD; }
.page-header .breadcrumb a:hover { color: var(--accent); }

/* ============ Hero ============ */
.hero { border-bottom: 1px solid var(--bs-border-color); }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 65%; }
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(20,22,26,0.96) 0%, rgba(20,22,26,0.88) 32%, rgba(20,22,26,0.55) 58%, rgba(20,22,26,0.25) 100%);
}
.hero-pad { padding-top: 7.2rem; padding-bottom: 6rem; }
/* Sits over a photo, so the muted secondary grey doesn't hold up - especially
   on mobile where the scrim is lighter. Near-white with a slight text shadow
   for legibility against the busiest parts of the image. */
.hero-lead {
  font-size: 1.1rem;
  max-width: 560px;
  color: #E8EAEC;
  text-shadow: 0 1px 3px rgba(20, 22, 26, 0.55);
}

@media (max-width: 640px) {
  .hero-pad { padding-top: 5.5rem; padding-bottom: 4rem; }
  .hero-scrim { background: linear-gradient(180deg, rgba(20,22,26,0.86) 0%, rgba(20,22,26,0.72) 50%, rgba(20,22,26,0.55) 100%); }
}

/* ============ Trust strip ============ */
/* Made deliberately prominent - accent-topped, larger type, divider lines
   between columns - this is a KPI band, not a footnote. */
.trust-strip { background: #FFFFFF; border-top: 3px solid var(--accent); border-bottom: 1px solid #E3E1DC; padding: 30px 0; box-shadow: 0 8px 24px rgba(20,22,26,0.08); }
.trust-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 20px;
  border-left: 1px solid #E3E1DC;
}
.row.trust-inner > .trust-item:first-child { border-left: none; }
.trust-label { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.trust-value { font-size: 1.18rem; font-weight: 700; color: #14161A; line-height: 1.25; }

.trust-ticker { display: none; }

@media (max-width: 767px) {
  .trust-inner { display: none; }
  .trust-ticker {
    display: block;
    position: relative;
    overflow: hidden;
    min-height: 58px;
  }
  .trust-ticker-item {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    padding: 0 24px;
    transform: translateX(120vw);
  }
  .trust-ticker-item .trust-label { color: var(--accent); font-weight: 600; }
  .trust-ticker-item .trust-value { color: #14161A; font-size: 1.18rem; font-weight: 700; }
  .trust-ticker-item:nth-child(1) { animation: trustTicker 12s linear infinite; animation-delay: -0.4s; }
  .trust-ticker-item:nth-child(2) { animation: trustTicker 12s linear infinite; animation-delay: 2.6s; }
  .trust-ticker-item:nth-child(3) { animation: trustTicker 12s linear infinite; animation-delay: 5.6s; }
  .trust-ticker-item:nth-child(4) { animation: trustTicker 12s linear infinite; animation-delay: 8.6s; }
}

@keyframes trustTicker {
  0%   { transform: translateX(120vw); }
  4%   { transform: translateX(0); }
  21%  { transform: translateX(0); }
  25%  { transform: translateX(-120vw); }
  100% { transform: translateX(-120vw); }
}

@media (prefers-reduced-motion: reduce) {
  .trust-ticker-item { position: relative; transform: none !important; animation: none !important; }
}

/* ============ Quote form (card layout ported from source template) ============ */
/* The negative bottom margin is the mechanic from the source template: the card
   overlaps the section below it so the two sections visually interlock rather
   than sitting in separate stacked bands. z-index keeps it above the next
   section's background. */
.quote-form-section {
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: -60px;
  position: relative;
  z-index: 10;
  background: transparent;
}
.quote-form-card {
  background: #FFFFFF;
  padding: 40px 36px 36px;
  border-radius: 2px;
  border-top: 4px solid var(--accent);
  box-shadow: 0 14px 40px rgba(20, 22, 26, 0.18);
  position: relative;
  z-index: 5;
}
.quote-form-card h2 { margin-bottom: 0.4rem; }
.quote-form-submit { margin-top: 34px; }
.quote-form-reassure {
  margin-top: 14px;
  margin-bottom: 0;
  font-size: 0.86rem;
  color: var(--bs-secondary-color);
}
.quote-form-lead { color: var(--bs-secondary-color); margin-bottom: 1.5rem; }
.quote-form-lead a { color: var(--accent); font-weight: 600; }
.quote-form-card .form-label {
  color: #5B6067;
  font-weight: 600;
  font-size: 0.86rem;
  margin-top: 14px;
  margin-bottom: 4px;
  text-transform: none;
}
.quote-form-card .form-control {
  background: #FFFFFF;
  border: 1px solid #C8C5BE;
  border-radius: 2px;
  font-size: 0.95rem;
  color: #14161A;
}
.quote-form-card .form-control:focus {
  background: #FFFFFF;
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(245, 166, 35, 0.2);
}
.quote-form-card textarea.form-control { resize: none; }
/* Section immediately after the form needs top padding to clear the overlap. */
.quote-form-section + .section-block { padding-top: 100px; }

/* Dark band variant - used under the quote form so the white card visibly
   overlaps it. White-card-on-white-section makes the overlap invisible. */
.section-block--dark {
  background: #14161A;
  border-top: none;
  border-bottom: none;
}

/* ============ Audience split cards (scaffold-for pages) ============ */
.audience-card {
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-left: 3px solid var(--accent);
  padding: 30px 28px;
  border-radius: 2px;
  height: 100%;
}
.audience-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.audience-card h3 { margin-bottom: 12px; font-size: 1.25rem; }
.audience-card p { color: var(--bs-secondary-color); font-size: 0.98rem; }

/* ============ Job list items (scaffold-for pages) ============ */
.joblist-item {
  border-top: 1px solid var(--bs-border-color);
  padding-top: 20px;
  height: 100%;
}
.joblist-item h3 { margin-bottom: 8px; font-size: 1.1rem; }
.joblist-item p { color: var(--bs-secondary-color); font-size: 0.98rem; margin-bottom: 0; }
.joblist-item a { color: var(--accent); }
.joblist-item a:hover { text-decoration: underline; }

/* ============ Coverage map (areas hub) ============ */
.coverage-map { max-width: 420px; margin: 0 auto; }
.coverage-map svg { width: 100%; height: auto; }
.map-ring { fill: none; stroke: var(--bs-border-color); stroke-width: 1; }
.map-ring--outer { stroke-dasharray: 4 5; }
.map-axis { stroke: var(--bs-border-color); stroke-width: 1; }
.map-dot { fill: var(--bs-secondary-color); }
.map-dot--home { fill: var(--accent); }
.map-label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--bs-secondary-color);
  letter-spacing: 0.04em;
}
.map-label--home { fill: var(--bs-body-color); font-size: 12px; letter-spacing: 0.1em; font-weight: 600; }

/* ============ Town cards (areas hub) ============ */
.town-card {
  display: block;
  height: 100%;
  padding: 26px 24px;
  border: 1px solid var(--bs-border-color);
  border-radius: 2px;
  background: var(--bs-tertiary-bg);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.town-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.town-card h3 { margin-bottom: 8px; font-size: 1.3rem; color: var(--bs-body-color); }
.town-card:hover h3 { color: var(--accent); }
.town-card p { color: var(--bs-secondary-color); font-size: 0.96rem; margin-bottom: 14px; }
.town-card-link { font-family: var(--font-mono); font-size: 0.84rem; color: var(--accent); }

/* ============ Licence panel (areas pages) ============ */
.licence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin: 28px 0;
}
.licence-item {
  border: 1px solid var(--bs-border-color);
  border-top: 3px solid var(--accent);
  padding: 20px 20px 16px;
  border-radius: 2px;
  background: var(--bs-tertiary-bg);
}
.licence-authority {
  font-weight: 700;
  font-size: 1rem;
  color: var(--bs-body-color);
  margin-bottom: 4px;
}
.licence-towns {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.licence-detail { font-size: 0.92rem; color: var(--bs-secondary-color); margin-bottom: 0; }
.licence-note { font-size: 0.92rem; color: var(--bs-secondary-color); }

/* ============ Contact page methods ============ */
.contact-method {
  border-top: 1px solid var(--bs-border-color);
  padding-top: 16px;
  margin-bottom: 22px;
}
.contact-method-label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.contact-method-value { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.contact-method-value a { color: var(--bs-body-color); }
.contact-method-value a:hover { color: var(--accent); }
.contact-method-note { font-size: 0.9rem; color: var(--bs-secondary-color); margin-bottom: 0; }

/* ============ Legal pages ============ */
.legal-body h2 {
  font-size: 1.35rem;
  margin-top: 2.2rem;
  margin-bottom: 0.7rem;
}
.legal-body h2:first-of-type { margin-top: 0; }
.legal-body p { color: var(--bs-secondary-color); }
.legal-body a { color: var(--bs-link-color); text-decoration: underline; }
.legal-updated {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--bs-secondary-color);
  margin-bottom: 2rem;
}

/* ============ Section blocks ============ */
.section-block { background: var(--bs-body-bg); color: var(--bs-body-color); padding: 68px 0; }
.section-block--tight { padding-bottom: 20px; }
.section-block--alt { --bs-tertiary-bg: #FFFFFF; background: #FFFFFF; border-top: 1px solid var(--bs-border-color); border-bottom: 1px solid var(--bs-border-color); }
.section-head { margin-bottom: 36px; }
.section-lead { font-size: 1.02rem; color: var(--bs-secondary-color); }
.section-cta { margin-top: 28px; }
.scaffold-for-intro, .areas-intro { font-size: 1.02rem; color: var(--bs-secondary-color); margin-bottom: 32px; }
/* ============ FAQ accordion ============ */
/* Same reasoning as the dropdown override - set the component's own vars
   directly rather than trusting inherited colour-mode vars in this alpha. */
.accordion {
  --bs-accordion-bg: transparent;
  --bs-accordion-color: var(--bs-body-color);
  --bs-accordion-border-color: var(--bs-border-color);
  --bs-accordion-btn-color: var(--bs-body-color);
  --bs-accordion-active-color: var(--accent-ink);
  --bs-accordion-active-bg: rgba(245, 166, 35, 0.1);
  --bs-accordion-btn-focus-border-color: var(--accent);
  --bs-accordion-btn-focus-box-shadow: 0 0 0 0.2rem rgba(245, 166, 35, 0.25);
}
.accordion-button { font-weight: 600; font-size: 1.02rem; }
.accordion-body { color: var(--bs-secondary-color); font-size: 0.98rem; }
/* Items need their own definition when the section behind them is white,
   otherwise a transparent accordion has nothing to read against. */
.accordion-item {
  border: 1px solid var(--bs-border-color);
  margin-bottom: 10px;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(20, 22, 26, 0.05);
}
.accordion-item:last-child { margin-bottom: 0; }

/* ============ Service cards ============ */
.service-card {
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  padding: 28px 24px;
  border-radius: 2px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.service-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.service-card-icon { margin-bottom: 18px; }
.service-card-icon svg { width: 34px; height: 34px; stroke: var(--accent); fill: none; stroke-width: 1.6; }
.service-card h3 { margin-bottom: 8px; }
.service-card p { font-size: 0.98rem; color: var(--bs-secondary-color); margin-bottom: 14px; }
.card-link { font-family: var(--font-mono); font-size: 0.86rem; letter-spacing: 0.03em; color: var(--accent); }
.card-link:hover { text-decoration: underline; }

/* ============ Use case tags ============ */
.use-case {
  border: 1px solid var(--bs-border-color);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bs-body-color);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.use-case:hover { border-color: var(--accent); background: rgba(245, 166, 35, 0.08); color: var(--accent); }

/* ============ Gallery ============ */
.gallery-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 2px;
  border: 1px solid var(--bs-border-color);
}
.gallery-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-placeholder {
  aspect-ratio: 4 / 3;
  background:
    repeating-linear-gradient(45deg, var(--bs-tertiary-bg) 0 2px, transparent 2px 14px),
    var(--bs-body-bg);
  border: 1px dashed var(--bs-border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}
.gallery-placeholder span { font-family: var(--font-mono); font-size: 0.86rem; color: var(--bs-secondary-color); }

/* ============ Why item ============ */
.why-index {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-ink);
  background: var(--accent);
  width: 30px;
  height: 30px;
  min-width: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
}
.why-item h3 { margin-bottom: 4px; }
.why-item p { font-size: 1rem; color: var(--bs-secondary-color); margin-bottom: 0; }
/* Stacked variant: numbered step blocks where the index sits above the heading
   rather than beside it (process/how-it-works layouts). */
.why-item > .why-index { margin-bottom: 14px; }

/* ============ Areas ============ */
.area-list a {
  display: block;
  padding: 12px 20px;
  border: 1px solid var(--bs-border-color);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--bs-body-color);
  border-radius: 2px;
}
.area-list a:hover { border-color: var(--accent); color: var(--accent); }

/* ============ CTA band ============ */
.cta-band { background: #22262C; border-top: 1px solid #2C3038; }
.cta-inner { padding: 52px 0; }
.cta-inner h2 { margin-bottom: 6px; }
.cta-inner p { margin: 0; color: var(--bs-secondary-color); }

/* ============ Footer ============ */
.site-footer { background: var(--bs-body-bg, #14161A); border-top: 1px solid #2C3038; padding-top: 64px; }
.footer-grid { padding-bottom: 48px; }
.footer-grid p { font-size: 0.88rem; color: #8B929B; }
.footer-title { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: #565C64; margin-bottom: 16px; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a, .footer-links li { font-size: 0.96rem; color: #8B929B; }
.footer-links a:hover { color: var(--accent); }

.footer-bottom { border-top: 1px solid #2C3038; padding: 20px 0; }
.footer-bottom p { font-size: 0.8rem; color: #565C64; }
.footer-bottom a { font-size: 0.8rem; color: #565C64; }
.footer-bottom a:hover { color: var(--accent); }
