/*
Theme Name: Peace Within
Theme URI: https://wwebdesign.co.uk/
Author: W Web Design & Hosting
Author URI: https://wwebdesign.co.uk/
Description: Hand-built ACF block theme for Peace Within Wellbeing. A like-for-like rebuild of the Kadence + Elementor Pro + JetEngine site: 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: peacewithin
*/

/* ==========================================================================
   Accessibility floor (from the acf-blocks skill's tokens.css, renamed pw-).
   This site is LIKE FOR LIKE with the Elementor build, so the brand colours
   below are exactly the old ones. Where a pair misses AA on the old site it is
   marked in the table under "Design tokens" and kept, not silently changed.
   ========================================================================== */

:root {
  /* ---- brand, as FILLS --------------------------------------------------- */
  --pw-accent:        #588157; /* Elementor accent: button fill, green band */
  --pw-on-accent:     #ffffff; /* 4.48:1 on the accent: 0.02 under AA for 15px text.
                                  Same as the old site; see CLAUDE.md "open items". */
  --pw-secondary:     #5B4E44; /* Elementor secondary: top bar, brown band, hover. White on it 8.02:1 */
  --pw-on-secondary:  #ffffff;
  --pw-primary:       #CB997E; /* Elementor primary: the tan used for headings and icons.
                                  2.5:1 on white, 3.21:1 on brown: large text and icons only */

  /* ---- brand, as TEXT ---------------------------------------------------- */
  --pw-link:          #587954; /* Kadence palette 1: link colour, 4.68:1 on the page bg */
  --pw-link-hover:    #5B4E44; /* Kadence palette 2 */

  /* ---- neutrals (Kadence palette) ---------------------------------------- */
  --pw-ink:           #2D3748; /* palette 4: body text, 11.44:1 on the page bg */
  --pw-ink-strongest: #1A202C; /* palette 3: h1, h2, h3 */
  --pw-ink-medium:    #4A5568; /* palette 5: h5, h6, form text */
  --pw-ink-subtle:    #718096; /* palette 6: placeholders */
  --pw-text:          #7A7A7A; /* Elementor "text": body copy inside Elementor widgets
                                  and the footer. 4.29:1 on white, 4.10:1 on the page bg
                                  (under AA, as on the old site) */
  --pw-bg-page:       #F7FAFC; /* palette 8: the page background */
  --pw-bg-subtle:     #EDF2F7; /* palette 7: Kadence title band */
  --pw-bg-accent:     #F5EBE0; /* Elementor "background accent" */
  --pw-white:         #ffffff;

  /* TWO border tokens, deliberately: a hairline is decoration, the edge of a
     CONTROL needs 3:1 (WCAG 1.4.11). */
  --pw-hairline:      #E2E8F0;
  --pw-border-ui:     #8c8c8c; /* 3.06:1 on white: anything that bounds a control */
  --pw-input-border:  #CBD5E0; /* Kadence form-field border (kept: like for like) */
}

/* ---- focus, which is a component and needs 3:1 ------------------------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--pw-secondary);
  outline-offset: 2px;
  border-radius: 2px;
}
/* The ring INVERTS on dark grounds: brown on brown vanishes. */
:where(.pw-band--brown, .pw-band--green, .pw-band--image, .pw-topbar, .pw-hero) :is(a, button, input, [tabindex]):focus-visible {
  outline-color: #ffffff;
}
:where(.pw-btn):focus-visible { outline-color: var(--pw-secondary); outline-offset: 3px; }
:where(.pw-band--brown, .pw-band--green, .pw-band--image) .pw-btn:focus-visible { outline-color: #ffffff; }

/* The skip link must be VISIBLE when focused: the :focus half is a Level A
   requirement, not decoration. */
.pw-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.pw-sr-only:focus,
.pw-sr-only:focus-visible {
  position: fixed !important;
  top: 12px; left: 12px;
  width: auto; height: auto;
  padding: 12px 20px;
  margin: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  z-index: 10000;
  background: var(--pw-white);
  color: var(--pw-secondary);
  outline: 3px solid var(--pw-secondary);
}

/* ---- target size: 24x24 CSS px (WCAG 2.5.8) for standalone controls ----- */
.pw-icon-btn,
.pw-close,
.pw-pagination a,
.pw-pagination span,
.pw-share a {
  min-width: 24px;
  min-height: 24px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Fonts: self-hosted, latin subset, variable, OFL-1.1 (assets/fonts/LICENSE.md).
   The old site loaded these through Elementor's local copy of Google Fonts, so
   these are the same files. Figtree is used only by the footer's two small lines
   and by post meta text (see templates.css).
   ========================================================================== */

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("assets/fonts/cormorant-garamond-var.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("assets/fonts/cormorant-garamond-italic-var.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/nunito-var.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/nunito-italic-var.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("assets/fonts/figtree-var.woff2") format("woff2");
}

/* ==========================================================================
   Design tokens: type, layout.
   Every value read off the old site: Kadence's inline global CSS
   (--global-*, h1-h6, body), Elementor's kit (post-9: container 1140px, widget
   spacing 20px, h1 60px and h2 36px at 767px and below).
   ========================================================================== */

:root {
  --pw-font-body:    "Nunito", sans-serif;
  --pw-font-heading: "Cormorant Garamond", serif;
  --pw-font-meta:    "Figtree", sans-serif;

  /* Elementor boxed content width (kit): the content box of a boxed section is
     min(100% - 20px, 1140px): 10px of container padding each side. */
  --pw-container:    1140px;
  --pw-container-pad: 10px;
  /* Kadence's own page container (Policies, Account, archives): 1290px with a
     1.5rem edge. The card inside takes 2rem padding. */
  --pw-kadence-width: 1290px;
  --pw-edge:         1.5rem;

  /* Kadence spacing scale */
  --pw-sp-sm:  1.5rem;
  --pw-sp-md:  2rem;
  --pw-sp-xxl: 5rem;

  --pw-radius-card: .25rem;
  --pw-shadow-card: 0 15px 25px -10px rgba(0, 0, 0, .05);
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { box-sizing: border-box; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--pw-bg-page);
  color: var(--pw-ink);
  font-family: var(--pw-font-body);
  font-size: 17px;
  font-style: normal;
  font-weight: normal;
  line-height: 1.6;
}

img { display: block; max-width: 100%; height: auto; border-style: none; }
figure { margin: .5em 0; }
hr { height: 0; border: 0; border-bottom: 2px solid var(--pw-input-border); }
ul, ol { margin: 0 0 1.5em 1.5em; padding: 0; }
ul { list-style: disc; }
blockquote { padding-left: 1em; margin-left: 0; border-left: 4px solid var(--pw-ink); }
[hidden] { display: none !important; }

a {
  color: var(--pw-link);
  text-underline-offset: .1em;
  transition: all .1s linear;
}
a:hover, a:focus, a:active {
  color: var(--pw-link-hover);
  text-underline-offset: .25em;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  padding: 0;
  font-family: var(--pw-font-heading);
  line-height: 1.5;
}
h1 { font-weight: 700; font-size: 95px; color: var(--pw-ink-strongest); }
h2 { font-weight: 500; font-size: 48px; color: var(--pw-ink-strongest); }
h3 { font-weight: 700; font-size: 24px; color: var(--pw-ink-strongest); }
h4 { font-weight: 700; font-size: 22px; color: var(--pw-ink); }
h5 { font-weight: 700; font-size: 20px; color: var(--pw-ink); }
h6 { font-weight: 700; font-size: 18px; color: var(--pw-ink-medium); }
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { color: inherit; text-decoration: none; }

/* Elementor's kit shrinks the two big sizes on a phone (767px and below). */
@media (max-width: 767px) {
  h1 { font-size: 60px; }
  h2 { font-size: 36px; }
}

/* Form controls: Kadence's defaults. */
body.pw-bg-white { background: var(--pw-white); }
button, input, optgroup, select, textarea { font: inherit; font-size: 100%; margin: 0; }
input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="search"], input[type="number"], input[type="tel"], input[type="date"], textarea, select {
  -webkit-appearance: none;
  appearance: none;
  color: var(--pw-ink-medium);
  background: var(--pw-white);
  border: 1px solid var(--pw-input-border);
  border-radius: 3px;
  padding: .4em .5em;
  max-width: 100%;
}
::placeholder { color: var(--pw-ink-subtle); opacity: 1; }

/* ==========================================================================
   Layout
   ========================================================================== */

.pw-main { display: block; }

/* Elementor boxed section: content box min(100% - 20px, 1140px). */
.pw-wrap {
  width: min(100% - 2 * var(--pw-container-pad), var(--pw-container));
  margin-inline: auto;
}

/* Kadence's contained page: 1290px, 1.5rem edge. */
.pw-kadence-wrap {
  width: 100%;
  max-width: var(--pw-kadence-width);
  margin-inline: auto;
  padding-inline: var(--pw-edge);
}

/* ==========================================================================
   Prose: the editor content styling context. It is Kadence's `.single-content`
   (2rem between paragraphs, headings 1.5em above and .5em below, 2em list
   indent), and is what core-editor content (Policies, MemberPress pages) sits in.
   ========================================================================== */

.pw-prose > *:first-child { margin-top: 0; }
.pw-prose p, .pw-prose figure, .pw-prose hr, .pw-prose table, .pw-prose pre, .pw-prose form { margin: 0 0 2rem; }
.pw-prose h1, .pw-prose h2, .pw-prose h3, .pw-prose h4, .pw-prose h5, .pw-prose h6 { margin: 1.5em 0 .5em; }
.pw-prose h1:first-child, .pw-prose h2:first-child, .pw-prose h3:first-child,
.pw-prose h4:first-child, .pw-prose h5:first-child, .pw-prose h6:first-child { margin-top: 0; }
.pw-prose h1 + *, .pw-prose h2 + *, .pw-prose h3 + *, .pw-prose h4 + *, .pw-prose h5 + *, .pw-prose h6 + * { margin-top: 0; }
.pw-prose ul, .pw-prose ol { margin: 0 0 2rem; padding-left: 2em; }
.pw-prose li > ul, .pw-prose li > ol { margin: 0; }
.pw-prose > :last-child { margin-bottom: 0; }
.pw-prose img { height: auto; }
.pw-prose .alignleft  { float: left; margin: 0 1em 1em 0; }
.pw-prose .alignright { float: right; margin: 0 0 1em 1em; }
.pw-prose .aligncenter { margin-inline: auto; }
.pw-prose::after { content: ""; display: table; clear: both; }

/* ==========================================================================
   Buttons: the green pill, exactly as Elementor drew it.
   Elementor: padding 12px 24px, 1px solid border in the fill colour, Nunito 400,
   15px/1 (its default button size), white text, background #588157, hover
   background #5B4E44 (border stays green). Radius is per button on the old site:
   25px (the usual), 15px, 0, or Elementor's 3px default.
   ========================================================================== */

.pw-btns { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.pw-btns--center { justify-content: center; }
.pw-btns--start { justify-content: flex-start; }

.pw-btn {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid var(--pw-accent);
  border-radius: 25px;
  background: var(--pw-accent);
  color: var(--pw-on-accent);
  font-family: var(--pw-font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  fill: currentColor;
  transition: all .3s;
  cursor: pointer;
}
.pw-btn:hover, .pw-btn:focus, .pw-btn:visited { color: var(--pw-on-accent); text-decoration: none; }
.pw-btn:hover, .pw-btn:focus { background: var(--pw-secondary); border-color: var(--pw-accent); }
.pw-btn--soft    { border-radius: 15px; }
.pw-btn--classic { border-radius: 3px; }
.pw-btn--square  { border-radius: 0; }
/* The "See All Posts" button: tan text and outline on the green fill, square. */
.pw-btn--tan { border-color: var(--pw-primary); border-radius: 0; color: var(--pw-primary); }
.pw-btn--tan:hover, .pw-btn--tan:focus, .pw-btn--tan:visited { color: var(--pw-primary); }

/* ==========================================================================
   Bands: a band is a surface + ink PAIR, verified together (see tokens above).
   A band is a full-width background behind a section; the doubled selector beats
   a block's own stylesheet on specificity. Links inside a band's prose are
   scoped to prose so a call-to-action keeps its own button colours.
   ========================================================================== */

body .pw-band--white.pw-band--white { background: var(--pw-white);     color: var(--pw-ink); }
body .pw-band--sand.pw-band--sand   { background: var(--pw-bg-accent); color: var(--pw-ink); }
body .pw-band--mist.pw-band--mist   { background: var(--pw-bg-page);   color: var(--pw-ink); }
body .pw-band--brown.pw-band--brown { background: var(--pw-secondary); color: var(--pw-on-secondary); }
body .pw-band--green.pw-band--green { background: var(--pw-accent);    color: var(--pw-on-accent); }
body .pw-band--image.pw-band--image {
  position: relative;
  isolation: isolate;
  background: var(--pw-secondary) var(--pw-band-image, none) var(--pw-band-pos, center) / var(--pw-band-size, cover) no-repeat;
  color: #ffffff;
}
/* The overlay is the ONLY contrast guarantee over an editor-chosen photograph,
   so its floor is set here, not in a field. Elementor's was black at .5. */
.pw-band--image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--pw-band-ov, rgba(0, 0, 0, .5));
}

.pw-band--brown :is(h1, h2, h3, h4, h5, h6),
.pw-band--green :is(h1, h2, h3, h4, h5, h6),
.pw-band--image :is(h1, h2, h3, h4, h5, h6) { color: inherit; }

.pw-band--brown :is(p, li, dd, blockquote, .pw-prose) a:not(.pw-btn),
.pw-band--green :is(p, li, dd, blockquote, .pw-prose) a:not(.pw-btn),
.pw-band--image :is(p, li, dd, blockquote, .pw-prose) a:not(.pw-btn) {
  color: #ffffff;
  text-decoration-thickness: 2px;
}

/* ==========================================================================
   Section intro (pw_the_section_intro): eyebrow, heading, text.
   Phase 2 blocks add their own spacing and type overrides in their style.css.
   ========================================================================== */

.pw-intro--center { text-align: center; }
.pw-intro__eyebrow { margin: 0; }
.pw-intro__heading { margin: 0; }
.pw-intro__text { margin-top: 20px; }
.pw-intro__text > :last-child { margin-bottom: 0; }
