/*
Theme Name: Workplace Outdoor Products
Theme URI: https://wwebdesign.co.uk/
Author: W Web Design & Hosting
Author URI: https://wwebdesign.co.uk/
Description: Lean custom theme for Workplace Outdoor Products — 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: wop
*/

/* ==========================================================================
   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 — taken from the live Kadence palette on 1 September 2026. */
  --wop-brand:        #073769;   /* navy, palette1 */
  --wop-brand-dark:   #052646;
  --wop-accent:       #2a88ea;   /* bright blue, palette2 */
  --wop-accent-dark:  #1159af;

  /* Accessible variants.
     --wop-accent #2a88ea is 3.62:1 on white: fine for a rule, a dot or an icon
     (WCAG AA needs 3:1 for non-text), but it FAILS the 4.5:1 required of body
     text, and white on it as a button fails too. --wop-accent-text is 5.09:1 on
     white and 4.85:1 on the page background, so it passes both ways round.
     Use --wop-accent to decorate, --wop-accent-text to say something. */
  --wop-accent-text:  #1f6fc4;
  --wop-border-strong: #b9c6d4;   /* 2.3:1 on white; for borders that carry meaning */

  /* Surfaces.
     NEVER set a section background to #fff — leave sections transparent so
     they inherit --wop-bg, and fill --wop-card-bg on inner cards. */
  --wop-bg:           #F7FAFC;
  --wop-card-bg:      #ffffff;
  --wop-border:       #EDF2F7;

  /* Text */
  --wop-text:         #1A202C;
  --wop-text-muted:   #4A5568;
  --wop-text-invert:  #ffffff;

  /* Type — Bai Jamjuree matches the outgoing Kadence build. */
  --wop-font:         "Bai Jamjuree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wop-font-heading: var(--wop-font);

  /* Layout */
  --wop-content-max:  1200px;
  --wop-gutter:       24px;
  --wop-section-y:    clamp(48px, 7vw, 104px);
  /* Shape. The live site is close to square: measured radii across the whole
     page are 3px, 4px, 5px and 15px, with 50% only on round icon chips. The
     rebuild had drifted to 10/8/16 plus full pills, which is most of why it
     read as a different site. Matched to live. */
  --wop-radius:       4px;
  --wop-btn-radius:   3px;   /* live's Add to basket, exactly */
  --wop-header-height: 88px;
  /* The whole sticky header, which is taller than the top row below 992px
     (assets/header.css adds the search row). Use this, not --wop-header-height,
     for anything that has to clear the header. */
  --wop-header-offset: var(--wop-header-height);


  /* ----------------------------------------------------------------------
     Tokens required by the storefront and block CSS.

     product-card.css, shop.css, product.css and the category-tiles block were
     cloned from creationhoney and mlc, which define a far larger token set than
     the starter theme. Retokening the class names was not enough: 41 custom
     properties were referenced and never defined.

     Most degrade quietly, but `aspect-ratio: var(--wop-aspect-product)` has no
     fallback, so an undefined value made the whole declaration invalid and every
     product image rendered at its natural height. A category archive came out at
     12,027px tall, roughly one product per four screens on a phone.

     Structural and type values are the donor's. Colour values are THIS site's
     navy and blue, not the donor's honey.
     ---------------------------------------------------------------------- */

  /* Surfaces and ink */
  --wop-bg-alt:        #EDF2F7;
  --wop-brand-deep:    #052646;
  /* The navy live actually paints its buttons with. Slightly deeper than
     --wop-brand (#073769), which is the Kadence palette colour used for type. */
  --wop-btn-bg:        #09274B;
  --wop-brand-light:   #5aa6f0;
  --wop-brand-wash:    #eaf3fd;
  --wop-green:         #2a88ea;                    /* accent role, donor name kept so cloned CSS matches */
  --wop-heading:       #1A202C;
  --wop-ink-soft:      #2D3748;
  --wop-divider:       rgba(26, 32, 44, .08);

  /* Type scale */
  --wop-text-xs:       clamp(13px, 0.80rem + 0.10vw, 14px);
  --wop-text-sm:       clamp(14px, 0.85rem + 0.15vw, 15px);
  --wop-text-base:     clamp(16px, 0.95rem + 0.20vw, 17px);
  --wop-text-lg:       clamp(18px, 1.05rem + 0.30vw, 20px);
  --wop-text-xl:       clamp(22px, 1.20rem + 0.60vw, 25px);
  --wop-text-2xl:      clamp(26px, 1.40rem + 1.00vw, 31px);
  --wop-text-4xl:      clamp(38px, 2.00rem + 2.40vw, 49px);

  --wop-lh-tight:      1.08;
  --wop-lh-normal:     1.35;
  --wop-lh-relaxed:    1.65;
  --wop-ls-display:    -0.02em;
  --wop-ls-heading:    -0.01em;
  --wop-ls-caps:       0.06em;
  --wop-measure:       65ch;

  /* Shape and rhythm */
  --wop-radius-sm:     3px;
  --wop-radius-lg:     8px;
  /* Kept for genuinely circular chips (social icons, the search toggle), NOT
     for buttons — live has no pill buttons anywhere. */
  --wop-radius-pill:   999px;
  --wop-stack:         24px;
  --wop-grid-gap:      clamp(20px, 3vw, 32px);
  --wop-input-h:       48px;
  --wop-tap-min:       48px;                       /* WCAG 2.5.8 minimum target */

  /* Product imagery. NO FALLBACK EXISTS AT THE USE SITE: leave this defined. */
  --wop-aspect-product: 4 / 5;
  --wop-img-filter:    saturate(1.04) contrast(1.02);

  /* Document icon for download links, inlined so it costs no request. */
  --wop-doc-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zm0 0v6h6'  fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");

  /* Elevation and motion */
  --wop-shadow-sm:     0 1px 3px rgba(26, 32, 44, .08), 0 1px 2px rgba(26, 32, 44, .04);
  --wop-shadow:        0 6px 16px rgba(26, 32, 44, .10);
  --wop-shadow-lg:     0 12px 32px rgba(26, 32, 44, .10);
  --wop-shadow-honey:  0 6px 16px rgba(42, 136, 234, .30);   /* accent glow, donor name kept */
  --wop-dur:           200ms;
  --wop-transition:    200ms cubic-bezier(.22,.61,.36,1);

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

/* --------------------------------------------------------------------------
   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(--wop-bg);
  color: var(--wop-text);
  font-family: var(--wop-font);
  font-size: 17px;
  line-height: 1.65;
  -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(--wop-font-heading);
  /* Live sets headings UPPERCASE at weight 600 — measured on the live h1:
     Bai Jamjuree, 600, 60px, text-transform uppercase. The rebuild rendered
     them sentence case at the browser default weight, which reads as a
     different brand even before the typeface is considered. */
  text-transform: uppercase;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5em;
  text-wrap: balance;
}

/* Prose headings inside a wysiwyg block stay sentence case — uppercasing an
   article's h2 makes long-form copy unreadable, and live does not do it there. */
.wop-wysiwyg h2, .wop-wysiwyg h3, .wop-wysiwyg h4,
.wop-prose h2, .wop-prose h3, .wop-prose h4,
.entry-content h2, .entry-content h3, .entry-content h4 {
  text-transform: none;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); }

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

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

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

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

/* Two stacked sections each contributed a full --wop-section-y, so the gap
   between them was DOUBLE the gap between the hero and the first one: 169px
   against 84px. Measured on live the equivalent gap is 69px, so the rebuilt
   page was reading as though a section had gone missing in the white space.

   Collapse the boundary to a single gap. This is deliberately keyed on the
   generic `.wop-section`, which every block section carries, rather than on any
   one block's class — a collapse rule that names a block stops matching the
   moment that section becomes a different block, and the page silently grows.

   Banded sections (.wop-cta, .wop-imageband) do NOT carry .wop-section, so they
   keep their own padding and correctly break the chain: a coloured band needs
   its breathing room on both sides. */
.wop-section + .wop-section { padding-top: 0; }

.wop-section__head { max-width: 720px; margin-bottom: clamp(28px, 4vw, 48px); }
.wop-section__head--center { margin-inline: auto; text-align: center; }

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

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

/* Buttons */
.wop-btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .85em 1.6em;
  border: 1px solid transparent;
  border-radius: var(--wop-btn-radius);
  background: var(--wop-btn-bg);
  color: var(--wop-text-invert);
  /* Live sets every button UPPERCASE. It is the single most recognisable part
     of this site's voice, and dropping it was a large part of the drift. */
  text-transform: uppercase;
  letter-spacing: var(--wop-ls-caps);
  font-weight: 600;
  font-size: .9rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background .25s var(--wop-ease);
}
.wop-btn:hover { background: var(--wop-brand); }

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

/* Cards — the ONLY place --wop-card-bg should appear. */
.wop-card {
  background: var(--wop-card-bg);
  border: 1px solid var(--wop-border);
  border-radius: var(--wop-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(--wop-content-max) + 160px); margin-inline: auto; }
.aligncenter { margin-inline: auto; }
