/*
Theme Name: Watertight Roofing Ltd
Theme URI: https://wwebdesign.co.uk/
Author: W Web Design & Hosting
Author URI: https://wwebdesign.co.uk/
Description: Lean custom theme for Watertight Roofing Ltd — code-registered ACF blocks, no page builder, no build step.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: watertightroofingltd
*/

/* ==========================================================================
   Design tokens — the ONLY place cross-block values live.
   Anything used by more than one block belongs here. Anything used by exactly
   one block belongs in that block's own style.css.
   ========================================================================== */

:root {
  /* Brand — from the Elementor kit on the old site (system + Kadence colours). */
  --watertightroofingltd-brand:        #0E51A0;  /* Elementor "Accent" / kadence2 */
  --watertightroofingltd-brand-dark:   #0A3C77;
  --watertightroofingltd-accent:       #568BC7;  /* Elementor "Primary" / kadence1 */

  /* Surfaces.
     The old site alternated white and a pale blue-grey band down each page;
     --band is that band. NEVER set a section background to #fff — leave sections
     transparent so they inherit --watertightroofingltd-bg. */
  --watertightroofingltd-bg:           #ffffff;
  --watertightroofingltd-band:         #EDF2F7;  /* kadence7 "Subtle Background" */
  --watertightroofingltd-card-bg:      #F7FAFC;  /* kadence8 "Lighter Background" */
  --watertightroofingltd-border:       #dfe6ee;

  /* Text */
  --watertightroofingltd-text:         #1A202C;  /* kadence3 "Strongest text" */
  --watertightroofingltd-text-muted:   #718096;  /* kadence6 "Subtle Text" */
  --watertightroofingltd-text-body:    #4A5568;  /* kadence5 "Medium text" */
  --watertightroofingltd-text-invert:  #ffffff;

  /* Type — Montserrat, as the old Elementor kit specified (600 headings, 400 body). */
  --watertightroofingltd-font:         "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --watertightroofingltd-font-heading: var(--watertightroofingltd-font);

  /* Layout */
  --watertightroofingltd-content-max:  1140px;
  --watertightroofingltd-gutter:       24px;
  --watertightroofingltd-section-y:    clamp(44px, 6vw, 80px);
  --watertightroofingltd-radius:       4px;
  --watertightroofingltd-header-height: 112px;

  /* Motion */
  --watertightroofingltd-ease:         cubic-bezier(.22,.61,.36,1);
}

/* --------------------------------------------------------------------------
   Montserrat, self-hosted.

   The old site loaded this through Elementor's google-fonts cache in uploads/.
   That directory goes away with Elementor, and a fonts.googleapis.com link
   would be a third-party request on every page — so the latin subset ships in
   the theme. Google serves Montserrat as a variable font, so ONE file covers
   400/600/700; do not "fix" this back to three @font-face rules.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/montserrat-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC,
                 U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--watertightroofingltd-bg);
  color: var(--watertightroofingltd-text-body);
  font-family: var(--watertightroofingltd-font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--watertightroofingltd-font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--watertightroofingltd-text);
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 1.9vw, 1.35rem); }

/* The old site set every section heading in the brand blue and centred it. */
.watertightroofingltd-section__head h2 { color: var(--watertightroofingltd-brand); }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Shared layout primitives — used by chrome AND blocks.
   -------------------------------------------------------------------------- */

.watertightroofingltd-wrap {
  width: 100%;
  max-width: var(--watertightroofingltd-content-max);
  margin-inline: auto;
  padding-inline: var(--watertightroofingltd-gutter);
}

.watertightroofingltd-section { padding-block: var(--watertightroofingltd-section-y); }

/* Alternating pale band — the old site ran white / #EDF2F7 / white / #EDF2F7
   down the homepage. Applied per block via its own "band" field, not globally. */
.watertightroofingltd-section--band { background: var(--watertightroofingltd-band); }

/* Two sections on the SAME background stack their vertical padding, which reads
   as a hole twice the intended size — the Services page has two of them. Drop
   the second one's top padding. Sections either side of a colour change keep
   theirs, because there the padding is what separates the two bands. */
.watertightroofingltd-section:not(.watertightroofingltd-section--band)
  + .watertightroofingltd-section:not(.watertightroofingltd-section--band),
.watertightroofingltd-section--band + .watertightroofingltd-section--band {
  padding-top: 0;
}

.watertightroofingltd-section__head { max-width: 780px; margin-bottom: clamp(24px, 3.5vw, 40px); }
.watertightroofingltd-section__head--center { margin-inline: auto; text-align: center; }

.watertightroofingltd-eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--watertightroofingltd-accent);
  margin-bottom: .75em;
}

.watertightroofingltd-lede { font-size: 1rem; color: var(--watertightroofingltd-text-muted); }

/* Buttons — the old site's were small, near-square and solid brand blue. */
.watertightroofingltd-btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .8em 1.4em;
  border: 1px solid transparent;
  border-radius: var(--watertightroofingltd-radius);
  background: var(--watertightroofingltd-brand);
  color: var(--watertightroofingltd-text-invert);
  font-weight: 500;
  font-size: .85rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background .25s var(--watertightroofingltd-ease), transform .25s var(--watertightroofingltd-ease);
}
.watertightroofingltd-btn:hover { background: var(--watertightroofingltd-brand-dark); transform: translateY(-1px); }

.watertightroofingltd-btn--ghost {
  background: transparent;
  color: var(--watertightroofingltd-text);
  border-color: var(--watertightroofingltd-border);
}
.watertightroofingltd-btn--ghost:hover { background: var(--watertightroofingltd-card-bg); }

/* Cards — the ONLY place --watertightroofingltd-card-bg should appear. */
.watertightroofingltd-card {
  background: var(--watertightroofingltd-card-bg);
  border: 1px solid var(--watertightroofingltd-border);
  border-radius: var(--watertightroofingltd-radius);
  padding: clamp(20px, 2.5vw, 32px);
}

/* Screen-reader only */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* WP core alignment classes */
.alignfull { width: 100vw; max-width: 100vw; margin-inline: calc(50% - 50vw); }
.alignwide { max-width: calc(var(--watertightroofingltd-content-max) + 160px); margin-inline: auto; }
.aligncenter { margin-inline: auto; }
