/*
 * Webfluence Theme — wf-pages.css
 * ─────────────────────────────────────────────────────────────────
 * Loaded by:  functions.php → wf_enqueue_page_styles()
 * Version:    1.1.0
 * No framework. No dependencies. WP Rocket compatible.
 * ─────────────────────────────────────────────────────────────────
 *  TABLE OF CONTENTS
 *  1.  CSS Variables
 *  2.  Reset
 *  3.  Skip Link (Accessibility)
 *  4.  Focus Visible (Keyboard Navigation)
 *  5.  Layout
 *  6.  Block System
 *  7.  Block Label
 *  8.  Typography
 *  9.  CTA Buttons
 * 10.  Trust Bar
 * 11.  Stats Grid
 * 12.  Service / Industry Cards
 * 13.  Work Grid
 * 14.  Post Cards (Insights / Archive)
 * 15.  Pagination
 * 16.  Contact Form (WPForms overrides)
 * 17.  Single Post
 * 18.  Breadcrumb
 * 19.  Post Navigation
 * 20.  404 Page
 * 21.  Privacy Page
 * 22.  Address Element
 * 23.  Responsive
 * ─────────────────────────────────────────────────────────────────
 */

/* ── 1. CSS Variables ────────────────────────────────────────────── */
:root {
  --ink:         #0e0c0a;
  --paper:       #f4f0e8;
  --warm:        #e8e2d6;
  --bg-alt:      #eee8dc;
  --white:       #faf8f4;
  --gold:        #9a7a2a;
  --gold-lt:     #c8a040;
  --muted:       #7a7060;
  --rule:        #d4ccc0;
  --font-serif:  'Palatino Linotype','Book Antiqua',Palatino,Georgia,serif;
  --font-mono:   'Courier New',Courier,monospace;
  --max-w:       860px;
  --block-gap:   3px;
}

/* ── 2. Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-serif);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img  { max-width: 100%; height: auto; display: block; }
a    { color: var(--gold); }
a:hover { text-decoration: underline; }

/* ── 3. Skip Link (Accessibility) ───────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 9999;
  background: var(--ink);
  color: var(--warm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 10px 20px;
  text-decoration: none;
  text-transform: uppercase;
  transition: top 0.1s;
}
.skip-link:focus { top: 0; }

/* ── 4. Focus Visible ────────────────────────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) { outline: none; }

/* ── 5. Layout ───────────────────────────────────────────────────── */
.wf-main      { padding: 40px 0 80px; }
.wf-container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.wf-blocks    { display: flex; flex-direction: column; gap: var(--block-gap); }

/* ── 6. Block System ─────────────────────────────────────────────── */
/*
 * Every section on every page is a .wf-block with a modifier.
 * Modifier controls background colour and left-border accent.
 *
 * --hero    White background, dark ink border   → Page openers
 * --alt     Cream background, rule border        → Alternating sections
 * --dark    Ink background, gold border          → Stats / featured
 * --gold    Gold background, no border           → CTAs
 * --trust   Cream, rule border, reduced padding  → Trust bar
 * --location Cream, warm border                 → Address block
 * --privacy  White, no special treatment         → Privacy page
 */
.wf-block {
  padding: 44px 48px;
  border-left: 4px solid var(--rule);
  background: var(--white);
}
.wf-block--hero     { border-left-color: var(--ink); }
.wf-block--alt      { background: var(--bg-alt); }
.wf-block--dark     { background: var(--ink); border-left-color: var(--gold); }
.wf-block--gold     { background: var(--gold-lt); border-left-color: transparent; }
.wf-block--trust    { background: var(--bg-alt); border-left-color: var(--rule); padding: 20px 48px; }
.wf-block--location { background: var(--bg-alt); border-left-color: #c0b89a; }
.wf-block--privacy  { background: var(--white); border-left-color: var(--rule); }

/* ── 7. Block Label ──────────────────────────────────────────────── */
.wf-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
/* Dark bg → warm/amber label */
.wf-block--dark     .wf-label { color: rgba(200,160,64,0.75); }
/* Gold bg → dark/muted label (was near-white = illegible — fixed) */
.wf-block--gold     .wf-label { color: rgba(14,12,10,0.45); }

/* ── 8. Typography —───────────────────────────────────────────────── */
.wf-block h1 {
  font-size: clamp(21px, 3.8vw, 33px);
  font-weight: 700;
  font-style: italic;
  line-height: 1.2;
  letter-spacing: -0.4px;
  margin-bottom: 18px;
  max-width: 700px;
}
.wf-block h2 {
  font-size: clamp(19px, 2.8vw, 26px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.3px;
  margin-bottom: 14px;
  max-width: 680px;
}
.wf-block h3 {
  font-size: clamp(16px, 2.2vw, 20px);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}
.wf-block p {
  font-size: 15.5px;
  line-height: 1.92;
  color: #2e2a22;
  max-width: 680px;
  margin-bottom: 20px;
}
.wf-block p:last-of-type { margin-bottom: 0; }

/* Dark/Gold text overrides */
.wf-block--dark h1, .wf-block--dark h2, .wf-block--dark h3 { color: var(--warm); }
.wf-block--dark p  { color: rgba(232,226,214,0.82); }
.wf-block--gold h1, .wf-block--gold h2, .wf-block--gold h3 { color: var(--ink); }
.wf-block--gold p  { color: rgba(14,12,10,0.85); }

/* Sub-heading italic */
.wf-sub {
  display: block;
  font-size: 14.5px;
  font-style: italic;
  color: var(--gold);
  line-height: 1.55;
  margin-bottom: 16px;
  max-width: 640px;
}
.wf-block--dark .wf-sub { color: rgba(200,160,64,0.75); }

/* Trust bar paragraph */
.wf-trust-text {
  font-size: 14px;
  font-style: italic;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

/* Keyword row (inside service/industry blocks) */
.wf-kw {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--rule);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  line-height: 1.8;
}
.wf-kw strong { color: var(--gold); }

/* Card emoji */
.wf-card-emoji {
  font-size: 22px;
  display: block;
  margin-bottom: 8px;
}

/* ── 9. CTA Buttons ──────────────────────────────────────────────── */
.wf-cta-wrap { margin-top: 10px; }

.wf-btn {
  display: inline-block;
  background: var(--ink);
  color: var(--warm) !important;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 12px 26px;
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s;
  margin-top: 10px;
}
.wf-btn:hover                 { background: #2a2520; text-decoration: none !important; }
.wf-btn--inv                  { background: var(--white); color: var(--ink) !important; border: 1.5px solid var(--ink); }
.wf-btn--inv:hover            { background: var(--warm); }
.wf-btn--gold-inv             { background: transparent; color: var(--ink) !important; border: 2px solid var(--ink); }
.wf-btn--gold-inv:hover       { background: rgba(14,12,10,0.08); }

/* CTA sub-note */
.wf-cta-note {
  display: block;
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 8px;
  max-width: 500px;
}
.wf-block--dark .wf-cta-note { color: rgba(250,248,244,0.4); }
.wf-block--gold .wf-cta-note { color: rgba(14,12,10,0.45); }
.wf-block--gold .wf-cta-note a { color: var(--ink); }

/* ── 10. Trust Bar ───────────────────────────────────────────────── */
/* Styles already covered by .wf-block--trust + .wf-trust-text above */

/* ── 11. Stats Grid ──────────────────────────────────────────────── */
.wf-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 28px;
}
.wf-stat           { border-top: 2px solid var(--gold); padding-top: 14px; }
.wf-stat__val      {
  display: block;
  font-size: 30px;
  font-weight: 700;
  color: var(--warm);
  letter-spacing: -1px;
  margin-bottom: 7px;
}
.wf-stat__label    {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #5a5040;
  line-height: 1.55;
}

/* ── 12. Service / Industry Cards ────────────────────────────────── */
/* These reuse .wf-block styles with .wf-card-emoji and .wf-sub */

/* ── 13. Work Grid ───────────────────────────────────────────────── */
.wf-work-grid {
  display: flex;
  flex-direction: column;
  gap: var(--block-gap);
  margin-bottom: var(--block-gap);
}

/* ── 14. Post Cards (Insights / Archive) ────────────────────────── */
.wf-posts, .wf-work-grid {
  display: flex;
  flex-direction: column;
  gap: var(--block-gap);
}

.wf-post-card {
  background: var(--white);
  border-left: 4px solid var(--rule);
  padding: 28px 36px;
  transition: border-left-color 0.15s;
}
.wf-post-card:hover          { border-left-color: var(--gold); }

.wf-post-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.wf-post-title               { font-size: clamp(17px,2.2vw,21px); font-weight: 700; line-height: 1.25; margin-bottom: 10px; }
.wf-post-title a             { color: var(--ink); text-decoration: none; }
.wf-post-title a:hover       { color: var(--gold); }
.wf-post-excerpt             { font-size: 14px; color: var(--muted); line-height: 1.7; margin: 0; }
.wf-post-readmore            { font-size: 13px; color: var(--gold); margin-top: 10px; display: inline-block; }

.wf-no-posts {
  background: var(--bg-alt);
  border-left: 4px solid var(--rule);
  padding: 28px 36px;
  color: var(--muted);
  font-style: italic;
}

/* ── 15. Pagination ──────────────────────────────────────────────── */
.wf-pagination {
  padding: 24px 0 8px;
  display: flex;
  justify-content: center;
}
/* paginate_links with type='list' outputs <ul> */
.wf-pagination ul            { list-style: none; display: flex; gap: 6px; flex-wrap: wrap; padding: 0; margin: 0; }
.wf-pagination ul li         { display: flex; }
.wf-pagination a,
.wf-pagination span          {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  border: 1.5px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  background: var(--white);
  transition: all 0.12s;
}
.wf-pagination a:hover       { border-color: var(--gold); color: var(--gold); text-decoration: none; }
.wf-pagination .current      { background: var(--ink); color: var(--warm); border-color: var(--ink); }
.wf-pagination .dots         { border-color: transparent; background: transparent; color: var(--muted); }

/* ── 16. Contact Form (WPForms) ──────────────────────────────────── */
.wf-form-area {
  background: var(--white);
  border-left: 4px solid var(--rule);
  padding: 44px 48px;
}
.wf-form-wrap { margin-top: 18px; }

/* Field overrides */
.wf-form-area .wpforms-form input[type="text"],
.wf-form-area .wpforms-form input[type="email"],
.wf-form-area .wpforms-form input[type="tel"],
.wf-form-area .wpforms-form select,
.wf-form-area .wpforms-form textarea {
  font-family: var(--font-serif) !important;
  font-size: 15px !important;
  border: 1.5px solid var(--rule) !important;
  border-radius: 0 !important;
  background: var(--paper) !important;
  padding: 10px 14px !important;
  color: var(--ink) !important;
  transition: border-color 0.15s !important;
}
.wf-form-area .wpforms-form input:focus,
.wf-form-area .wpforms-form textarea:focus {
  border-color: var(--gold) !important;
  outline: none !important;
  box-shadow: none !important;
}
.wf-form-area .wpforms-form label {
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  letter-spacing: 1.5px !important;
  text-transform: uppercase !important;
  color: var(--muted) !important;
  margin-bottom: 6px !important;
}
.wf-form-area .wpforms-submit-container .wpforms-submit,
.wf-form-area .wpforms-form button[type="submit"] {
  background: var(--ink) !important;
  color: var(--warm) !important;
  font-family: var(--font-serif) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  border-radius: 0 !important;
  padding: 12px 28px !important;
  border: none !important;
  cursor: pointer !important;
  transition: background 0.15s !important;
}
.wf-form-area .wpforms-submit-container .wpforms-submit:hover { background: #2a2520 !important; }

/* ── 17. Single Post ─────────────────────────────────────────────── */

/* .wf-single is added to <main> on single post pages for any
   post-specific layout overrides without affecting other pages. */
.wf-single               { /* post-level overrides go here if needed */ }

/* wp_link_pages() (<!--nextpage-->) navigation */
.wf-post-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.wf-post-pages span      { font-weight: 700; color: var(--ink); }
.wf-post-pages a         {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border: 1.5px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.12s;
}
.wf-post-pages a:hover   { border-color: var(--gold); color: var(--gold); }

.wf-post-header          { padding-bottom: 36px; }
.wf-post-header__meta    {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
}
.wf-post-header__cat     { color: var(--gold); font-weight: 700; }
.wf-post-header__sep     { color: var(--rule); }
.wf-post-standfirst      {
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
  font-style: italic;
  max-width: 640px;
  margin-top: 12px;
}

/* Post body — rich text editing area */
.wf-post-body p          { font-size: 16px; line-height: 2; margin-bottom: 22px; }
.wf-post-body h2         { margin: 36px 0 14px; }
.wf-post-body h3         { margin: 28px 0 10px; }
.wf-post-body ul,
.wf-post-body ol         { padding-left: 22px; margin-bottom: 22px; }
.wf-post-body li         { font-size: 15.5px; line-height: 1.85; margin-bottom: 6px; }
.wf-post-body blockquote {
  border-left: 4px solid var(--gold);
  padding: 16px 24px;
  margin: 28px 0;
  background: var(--bg-alt);
}
.wf-post-body blockquote p { font-style: italic; font-size: 17px; color: var(--muted); margin: 0; }
.wf-post-body a          { color: var(--gold); border-bottom: 1px solid rgba(154,122,42,0.3); text-decoration: none; }
.wf-post-body a:hover    { border-bottom-color: var(--gold); }
.wf-post-body strong     { font-weight: 700; }
.wf-post-body em         { font-style: italic; }
.wf-post-body img        { max-width: 100%; height: auto; margin: 28px 0; }
.wf-post-body hr         { border: none; border-top: 1px solid var(--rule); margin: 36px 0; }
.wf-post-body code       {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-alt);
  padding: 2px 6px;
  border: 1px solid var(--rule);
}
.wf-post-body pre        {
  background: var(--ink);
  color: var(--warm);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 24px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
}
.wf-post-body pre code   { background: none; border: none; padding: 0; color: inherit; }

/* Post footer (tags) */
.wf-post-footer          { padding-top: 24px; padding-bottom: 24px; }
.wf-tag-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(154,122,42,0.3);
  padding: 3px 10px;
  margin: 4px 4px 4px 0;
  text-decoration: none;
}
.wf-tag-link:hover { border-color: var(--gold); text-decoration: none; }

/* ── 18. Breadcrumb ──────────────────────────────────────────────── */
.wf-breadcrumb {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 18px;
}
.wf-breadcrumb a             { color: var(--muted); text-decoration: none; }
.wf-breadcrumb a:hover       { color: var(--gold); }
.wf-breadcrumb span          { color: var(--rule); }

/* ── 19. Post Navigation (Prev / Next) ───────────────────────────── */
.wf-post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--block-gap);
  margin-top: var(--block-gap);
}
.wf-post-nav__item {
  background: var(--white);
  border-left: 4px solid var(--rule);
  padding: 24px 28px;
  transition: border-left-color 0.15s;
}
.wf-post-nav__item:hover { border-left-color: var(--gold); }
.wf-post-nav__item a     { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600; line-height: 1.3; }
.wf-post-nav__item a:hover { color: var(--gold); }

/* ── 20. 404 Page ────────────────────────────────────────────────── */
.wf-404-links ul   { list-style: none; padding: 0; margin: 20px 0 0; }
.wf-404-links li   { border-top: 1px solid var(--rule); }
.wf-404-links li:last-child { border-bottom: 1px solid var(--rule); }
.wf-404-links a    {
  display: block;
  padding: 14px 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.12s;
}
.wf-404-links a:hover { color: var(--gold); padding-left: 6px; }

/* ── 21. Privacy Page ────────────────────────────────────────────── */
.wf-privacy h2   { font-size: 20px; margin: 30px 0 12px; }
.wf-privacy h3   { font-size: 16px; margin: 24px 0 8px; color: var(--gold); }
.wf-privacy p    { margin-bottom: 16px; font-size: 15px; }
.wf-privacy ul   { padding-left: 22px; margin-bottom: 16px; }
.wf-privacy li   { font-size: 15px; line-height: 1.85; margin-bottom: 4px; }
.wf-privacy a    { color: var(--gold); }

/* ── 22. Address Element ─────────────────────────────────────────── */
address         { font-style: normal; line-height: 1.9; }
address p       { margin-bottom: 8px; }
address a       { color: var(--gold); }

/* ── 23. Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .wf-block          { padding: 32px 28px; }
  .wf-block--trust   { padding: 16px 28px; }
  .wf-form-area      { padding: 32px 28px; }
  .wf-stats          { grid-template-columns: 1fr 1fr; }
  .wf-post-nav       { grid-template-columns: 1fr; }
  .wf-post-card      { padding: 24px 24px; }
}

@media (max-width: 480px) {
  .wf-block          { padding: 24px 18px; }
  .wf-block--trust   { padding: 12px 18px; }
  .wf-form-area      { padding: 24px 18px; }
  .wf-stats          { grid-template-columns: 1fr; }
  .wf-stat__val      { font-size: 24px; }
  .wf-post-card      { padding: 20px 18px; }
  .wf-post-title     { font-size: 17px; }
}

/* ── Screen Reader Only ──────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
