/**
 * PAL Neighbourhood Guide — Stylesheet
 * Property Around London
 * Based on Prototype F design system
 *
 * Version: 2.11.0
 * Last updated: 18 May 2026
 *
 * v2.11.0  2026-05-18  Editorial Verdict block visual hierarchy tightened
 *                      after the v3.4.0 template flip. The h3 "Who's
 *                      {Name} for?" was too prominent and the inner h4
 *                      advisory headings ("{Area} is likely to suit you
 *                      if:", "Look elsewhere if you:", "The Real
 *                      Picture") read as buried because they had no
 *                      scoped rule and inherited a near-body-text size.
 *                      Flipped the hierarchy: section h3 now matches the
 *                      restrained Future Outlook / Value Assessment h4
 *                      style (Spectral 600 / heading-md, padding below),
 *                      while the inner advisory h4s step up to
 *                      heading-lg with deliberate 32px / 16px vertical
 *                      rhythm so each conditional block reads as its
 *                      own sub-section. New rules in section 14a-iv.
 *
 * v2.10.0  2026-05-17  Sticky TOC restored. `.pal-guide` and `html/body`
 *                      changed from `overflow-x: hidden` to `overflow-x: clip`.
 *                      `hidden` silently kills `position: sticky` on every
 *                      descendant (CSS Overflow L3 spec); `clip` is the
 *                      modern equivalent that clips visually without
 *                      creating a new scrolling context. iOS Safari
 *                      horizontal-overflow defensive behaviour from
 *                      v2.8.4 is preserved — `clip` clips identically.
 *
 * Refactored: 14 April 2026
 * Changes from v1:
 *   - Merged March 2026 patch into main body (no more duplicate selectors)
 *   - Merged duplicate :root blocks into single token source
 *   - Introduced design tokens for typography, colour, spacing, shadows
 *   - Fixed border-radius: 50 bug (→ 50%)
 *   - Fixed shadow scale so sm < md < lg < xl genuinely progresses
 *   - Replaced ~60 hardcoded hex greys with semantic colour tokens
 *   - Replaced ad-hoc font sizes with type-scale tokens
 *   - Replaced ad-hoc spacing with spacing-scale tokens
 *   - Reduced !important from 63 → specificity strategy on .pal-guide wrapper
 *   - Standardised breakpoints to 3 values (480 / 768 / 900)
 *
 * Breakpoints:
 *   --bp-phone:   480px   (single-column everything)
 *   --bp-tablet:  768px   (2-col grids collapse, school columns stack)
 *   --bp-desktop: 900px   (sidebar hides, main layout stacks)
 */

/* ============================================================
   0. DESIGN TOKENS
   ============================================================ */
:root {
  /* ── PAL Palette ── */
  --pal-navy:   #1a2332;
  --pal-green:  #2d5f3f;
  --pal-cream:  #f8f6f1;
  --pal-red:    #c44536;
  --pal-blue:   #4a7c8c;
  --pal-gold:   #d4a574;

  /* Derived tints */
  --pal-navy-dark:   #243044;
  --pal-green-light: rgba(45,95,63,0.08);
  --pal-blue-light:  rgba(74,124,140,0.15);
  --pal-gold-light:  rgba(212,165,116,0.12);
  --pal-red-light:   rgba(196,69,54,0.08);

  /* Crime signal colours (merged from separate :root block) */
  --pal-signal-green: #3d7c4a;
  --pal-signal-amber: #e6a23c;
  --pal-signal-red:   #d85149;

  /* ── Semantic Text Colours ── */
  --text-heading:    var(--pal-navy);           /* Headings, strong text */
  --text-primary:    #2c3e50;                   /* Dark body text, input text */
  --text-body:       #5a6a72;                   /* Standard body copy */
  /* v2.9.0 (11 May 2026) — WCAG AA contrast fix.
     --text-muted was #6c757d (4.34:1 on cream) and --text-caption was
     #95a5a6 (2.37:1 on cream) — both failed WCAG AA 4.5:1. The body p
     default in this stylesheet uses --text-muted, so every paragraph on
     every guide was failing legal accessibility minimums. Darkened both
     tokens to AA-passing values; visual hierarchy below body kept by
     leaving caption slightly lighter than muted/body. */
  --text-muted:      #5a6a72;                   /* Secondary body, labels — 5.20:1 on cream (was #6c757d / 4.34:1) */
  --text-caption:    #647078;                   /* Captions, metadata, sources — 4.71:1 on cream (was #95a5a6 / 2.37:1) */
  --text-faint:      #b0b8c4;                   /* Disclaimers, placeholders — NOTE: still <4.5:1, only acceptable for non-essential text */
  --text-white-high: rgba(255,255,255,0.92);    /* White text on dark bg */
  --text-white-mid:  rgba(255,255,255,0.7);     /* Muted white on dark bg */
  --text-white-low:  rgba(255,255,255,0.5);     /* Faint white on dark bg */

  /* ── Typography Scale ── */
  --font-display: 'Spectral', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Heading sizes */
  --heading-xl:   1.5rem;     /* Section titles */
  --heading-lg:   1.2rem;     /* Sub-section headings */
  --heading-md:   1.05rem;    /* Card headings, sub-headings */
  /* v2.9.1 (11 May 2026) — P0-2 from the 11 May Wwai Lexicon audit.
     --text-base was 0.92rem (14.72px), below the 16px modern body baseline.
     Lifted to 1rem; --heading-sm bumped in step from 0.9rem to 1.05rem so
     sidebar headings don't end up smaller than the body they introduce
     (they remain visually distinct via Spectral serif + weight 600 vs
     Inter regular on body). --text-sm and below intentionally left alone
     so card descriptions and labels read as a clearer step below body. */
  --heading-sm:   1.05rem;    /* Sidebar headings, small titles — was 0.9rem; lifted to keep above body */

  /* Body text sizes */
  --text-base:    1rem;       /* Standard body copy — was 0.92rem (14.72px); now 16px (modern baseline) */
  --text-sm:      0.85rem;    /* Compact text, card descriptions */
  --text-xs:      0.78rem;    /* Small labels, legend items */
  --text-xxs:     0.72rem;    /* Source citations, fine print */
  --text-tiny:    0.65rem;    /* Badges, disclaimers */

  /* Data/display sizes */
  --data-hero:    2.2rem;     /* Hero price, big stat */
  --data-lg:      1.5rem;     /* Price cards, commute times */
  --data-md:      1.4rem;     /* Stat values */
  --data-sm:      1.15rem;    /* Budget tabs, inline data */

  /* Line heights */
  --lh-tight:     1.1;       /* Display numbers, hero text */
  --lh-snug:      1.35;      /* Headings */
  --lh-normal:    1.6;       /* UI text, captions */
  --lh-relaxed:   1.75;      /* Body copy */

  /* ── Spacing Scale ── */
  --sp-1:   0.25rem;   /*  4px */
  --sp-2:   0.5rem;    /*  8px */
  --sp-3:   0.75rem;   /* 12px */
  --sp-4:   1rem;      /* 16px */
  --sp-5:   1.25rem;   /* 20px */
  --sp-6:   1.5rem;    /* 24px */
  --sp-7:   2rem;      /* 32px */
  --sp-8:   2.5rem;    /* 40px */
  --sp-9:   3rem;      /* 48px */

  /* ── Borders & Shadows ── */
  --border-subtle:  1px solid rgba(26,35,50,0.04);
  --border-light:   1px solid rgba(26,35,50,0.06);
  --border-medium:  1px solid rgba(26,35,50,0.10);

  /* Shadow scale: sm < md < lg < xl (fixed — v1 had md > lg) */
  --shadow-sm:   0 1px 3px rgba(26,35,50,0.03);
  --shadow-md:   0 2px 4px rgba(26,35,50,0.03), 0 8px 20px rgba(26,35,50,0.05);
  --shadow-lg:   0 4px 8px rgba(26,35,50,0.04), 0 16px 40px rgba(26,35,50,0.07);
  --shadow-xl:   0 4px 8px rgba(26,35,50,0.08), 0 12px 28px rgba(26,35,50,0.12);

  /* ── Radii ── */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   14px;
  --radius-xl:   18px;
  --radius-pill:  9999px;

  /* ── Easing ── */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);

  /* ── Section Anchor Colours ── */
  --anchor-executive:  var(--pal-navy);
  --anchor-prices:     var(--pal-gold);
  --anchor-schools:    var(--pal-green);
  --anchor-transport:  var(--pal-blue);
  --anchor-crime:      var(--pal-red);
  --anchor-council:    var(--pal-navy);
  --anchor-community:  var(--pal-green);
  --anchor-verdict:    var(--pal-gold);
}

/* ============================================================
   1. BASE RESET & GLOBAL
   ============================================================
   Specificity strategy: all rules scoped under .pal-guide or
   .pal-guide.pal-guide (double-class) to outweigh inherited
   parent-theme globals without needing !important.
   ============================================================ */
.pal-guide * { margin: 0; padding: 0; box-sizing: border-box; }
.pal-guide { scroll-behavior: smooth; }
.pal-guide {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-primary);
  background: var(--pal-cream);
  /* v2.10.0 (17 May 2026) — Switched from `overflow-x: hidden` to
     `overflow-x: clip`. The `hidden` variant silently kills
     `position: sticky` on every descendant because it creates a new
     scrolling context (per CSS Overflow Module Level 3). `clip` has
     identical visual clipping behaviour but does NOT create a new
     scrolling context, so the sticky TOC sidebar (`.pal-guide-sidebar`,
     `position: sticky; top: 75px`) now actually sticks while the user
     scrolls. The iOS Safari horizontal-scale defensive fix from v2.8.4
     is preserved — `clip` clips horizontal overflow exactly the same
     way `hidden` did. Browser support: Chrome 90+, Firefox 81+,
     Safari 16+, Edge 90+ — universal by 2026. */
  overflow-x: clip;
  line-height: var(--lh-relaxed);
}

/* v2.8.4 (24 Apr 2026) — Defensive html/body width pinning.
   Background: iOS Safari has a legacy behaviour where, if a page ever
   renders with horizontal content > viewport width, Safari silently
   applies a scale-to-fit factor (typically 0.9x) to make the page fit.
   That scale gets cached per-domain and persists across page loads
   until the user clears website data — even AFTER the overflow source
   is removed. Result: a stubborn ~39px empty strip on the right side
   of every section, visible only on iOS Safari.

   These rules pin html and body to exactly the viewport width so there
   is no room for any element to accidentally re-introduce horizontal
   overflow in the future. Paired with the Deploy E min-width:0 fix
   (line ~400) and the viewport-meta hardening in single-neighborhoods.php. */
html, body {
  width: 100%;
  max-width: 100vw;
  /* v2.10.0 (17 May 2026) — `clip` instead of `hidden` for the same
     sticky-positioning reason documented above on `.pal-guide`. The
     iOS Safari horizontal-overflow defensive behaviour is preserved
     because `clip` clips overflow identically to `hidden`. */
  overflow-x: clip;
  margin-left: 0;
  margin-right: 0;
}

/* ── Double-class specificity override for body text ──
   This single block replaces the ~40 !important flags that were
   scattered across .pal-section-text, .pal-section p, etc.        */
.pal-guide.pal-guide p,
.pal-guide.pal-guide li,
.pal-guide.pal-guide td,
.pal-guide.pal-guide th {
  font-size: var(--text-base);
  color: var(--text-muted);
  font-family: var(--font-body);
  line-height: var(--lh-relaxed);
}
.pal-guide.pal-guide p,
.pal-guide.pal-guide li {
  margin-bottom: var(--sp-3);
}
.pal-guide.pal-guide strong {
  color: var(--text-primary);
}

/* Section intro/body text — inherits from the global reset above */
.pal-section-text {
  margin-bottom: var(--sp-4);
}

/* Grain texture overlay */
.pal-guide.grain::before {
  content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9999; opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ============================================================
   2. NAVIGATION
   ============================================================ */
.pal-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: var(--sp-3) var(--sp-7);
  background: rgba(248,246,241,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.pal-nav-logo {
  font-family: var(--font-display); font-weight: 700; font-size: var(--sp-4);
  color: var(--pal-navy); text-decoration: none;
}
.pal-nav-logo:hover { color: var(--pal-green); }
.pal-breadcrumb {
  font-size: var(--text-xs); color: var(--text-caption);
  display: flex; gap: 0.4rem; align-items: center;
}
.pal-breadcrumb a {
  color: var(--text-muted); text-decoration: none; transition: color 0.2s;
}
.pal-breadcrumb a:hover { color: var(--pal-green); }
.pal-breadcrumb a:focus-visible { outline: 2px solid var(--pal-green); outline-offset: 2px; }
.pal-breadcrumb-sep { color: #d0d0d0; }
.pal-breadcrumb-current { color: var(--text-primary); font-weight: 500; }

/* ============================================================
   3. HERO
   ============================================================ */
.pal-hero {
  position: relative; min-height: 60vh;
  display: flex; align-items: flex-end;
  overflow: hidden; margin-top: 50px;
  /* v2.8.2 (24 Apr 2026) — Fallback background so a broken hero image
     doesn't leave a 555px cream void on mobile. Behind the image itself. */
  background: var(--pal-navy, #1a2332);
}
.pal-hero-img { position: absolute; inset: 0; background: var(--pal-navy, #1a2332); }
.pal-hero-img img {
  width: 100%; height: 100%; object-fit: cover;
}
.pal-hero-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.55) 0%,
    rgba(0,0,0,0.25) 25%,
    transparent 45%
  );
  z-index: 1;
  pointer-events: none;
}
.pal-hero-content {
  position: relative; z-index: 2;
  padding: var(--sp-9) var(--sp-9) var(--sp-8); max-width: 800px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.8), 0 1px 4px rgba(0,0,0,0.6), 0 0 40px rgba(0,0,0,0.3);
}
.pal-hero-badges { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.pal-h-badge {
  padding: 0.3rem 0.8rem; border-radius: var(--radius-pill);
  font-size: 0.68rem; font-weight: 600;
}
.pal-h-badge--zone { background: rgba(74,124,140,0.8); color: white; }
.pal-h-badge--borough {
  background: rgba(26,35,50,0.8); color: white;
}
.pal-h-badge--rating { background: rgba(45,95,63,0.8); color: white; }
.pal-h-badge--price { background: rgba(212,165,116,0.8); color: white; }
.pal-h-badge--read {
  background: rgba(90,106,114,0.8); color: white;
}
.pal-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 600; color: white;
  line-height: 1.08; letter-spacing: -0.03em; margin-bottom: var(--sp-3);
}
.pal-hero h1 .pal-postcode {
  font-size: 0.45em; font-weight: 500; vertical-align: middle;
  background: rgba(255,255,255,0.12); padding: 0.15em 0.5em; border-radius: 6px;
  margin-left: var(--sp-2); letter-spacing: 0.02em;
}
.pal-hero-sub {
  font-family: var(--font-display) !important;
  font-size: clamp(1.1rem, 1.8vw, 1.45rem) !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  line-height: 1.2 !important;
  max-width: 700px;
  letter-spacing: -0.02em;
  margin-bottom: 0;
}
.pal-hero-meta {
  margin-top: var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.pal-hero-updated {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(45,95,63,0.8);
  color: white;
  margin: 0;
}
.pal-hero-updated .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #6fcf8d;
}

/* ============================================================
   4. EXECUTIVE SUMMARY
   ============================================================ */
.pal-exec {
  max-width: 1100px; margin: -2rem auto 0; padding: 0 var(--sp-7);
  position: relative; z-index: 3;
}
.pal-exec-card {
  background: white; border-radius: var(--radius-xl); padding: var(--sp-8);
  border: var(--border-subtle);
  box-shadow: var(--shadow-xl);
}
.pal-exec-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-7); padding-bottom: var(--sp-4);
  border-bottom: 3px solid var(--anchor-executive);
}
.pal-exec-header h2 {
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 600;
  color: var(--text-heading);
}
.pal-verdict-badge {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--text-sm); font-weight: 600; color: var(--pal-gold);
}

/* Stat grid */
.pal-stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5);
  margin-bottom: var(--sp-7);
}
.pal-stat-box {
  text-align: center; padding: var(--sp-5) var(--sp-3);
  background: var(--pal-cream); border-radius: var(--radius-md);
  transition: transform 0.3s var(--ease-bounce);
}
.pal-stat-box:hover { transform: translateY(-2px); }
.pal-stat-box:focus-visible { outline: 2px solid var(--pal-green); outline-offset: 2px; }
.pal-stat-icon { font-size: var(--data-md); margin-bottom: 0.4rem; }
.pal-stat-val {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  color: var(--pal-gold);
  letter-spacing: -0.02em;
}
.pal-stat-lbl {
  font-size: var(--text-xs); font-weight: 600; color: var(--text-body);
  margin-top: var(--sp-1);
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* Two-column exec narrative */
.pal-exec-narrative {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-7);
  margin-bottom: var(--sp-7);
}
.pal-exec-narrative-col h3 {
  font-family: var(--font-display); font-size: var(--sp-4); font-weight: 600;
  color: var(--text-heading); margin-bottom: var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-2);
}
.pal-exec-narrative-col p {
  font-size: var(--text-base); color: var(--text-muted); line-height: var(--lh-relaxed);
}

/* Key strengths / considerations */
.pal-exec-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6);
}
.pal-exec-col h3 {
  font-family: var(--font-display); font-size: var(--sp-4); font-weight: 600;
  color: var(--text-heading); margin-bottom: var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-2);
}
.pal-guide.pal-guide .pal-exec-col ul { list-style: none; padding-left: 0; margin: 0; }
.pal-guide.pal-guide .pal-exec-col li {
  font-size: 0.88rem; color: var(--text-muted); line-height: 1.7;
  padding: 0.35rem 0 0.35rem var(--sp-6); position: relative;
  list-style: none;
}
.pal-guide.pal-guide .pal-exec-col li::before {
  content: ''; position: absolute; left: 0; top: 0.85em;
  width: 7px; height: 7px; border-radius: 50%;
}
.pal-exec-col li p { margin: 0; }
.pal-exec-col li strong { font-weight: 600; }
.pal-strengths li::before { background: var(--pal-green); }
.pal-considerations li::before { background: var(--pal-red); }

/* ============================================================
   5. MAIN LAYOUT (content + sidebar)
   ============================================================ */
.pal-guide-layout {
  max-width: 1100px; margin: 0 auto; padding: var(--sp-9) var(--sp-7);
  display: grid; grid-template-columns: 1fr 280px; gap: var(--sp-9);
}
/* v2.8.3 (24 Apr 2026) — CSS Grid min-width fix.
   Grid items (main, aside) default to `min-width: auto`, which means they
   refuse to shrink below their content's intrinsic minimum width. On mobile,
   any nested element with non-wrapping text (e.g. the budget tab bar, a
   data table, a long unbreakable string) pushes `main` to ~654px on a
   428px viewport — the `1fr` track in grid-template-columns can't enforce
   the narrower size. Result: sections visually clip on the right edge
   because overflow-x:hidden on .pal-guide just hides the excess.
   Setting min-width:0 tells the grid item it IS allowed to shrink, so
   `1fr` actually means "whatever column width the grid says" rather than
   "at least my content's natural width". Verified live 24 Apr 2026:
   main goes from 654px → 396px on a 428px viewport. */
.pal-guide-layout > main,
.pal-guide-layout > aside { min-width: 0; }

/* ============================================================
   6. TABLE OF CONTENTS (sticky sidebar)
   ============================================================
   STICKY FIX (Apr 2026): `position: sticky` must be on the
   sidebar <aside> itself, not on .pal-toc inside it.
   When sticky is on a child, the child only sticks within the
   parent's own content height — once the ad placeholder,
   valuation CTA, and related-guides widget push the TOC up,
   it scrolls out of view.

   Moving sticky to the <aside> makes the entire sidebar column
   stick as a unit within the grid row, keeping the TOC visible
   for the full length of the content column.
   ============================================================ */
.pal-guide-sidebar {
  position: sticky;
  top: 75px;
  align-self: start;    /* prevents grid stretch — required for sticky */
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}

/* v2.9.5 (12 May 2026) — Scrollbar visibility fix.
   Previous values (width: 4px, thumb opacity 0.12) made the scrollbar
   essentially invisible — users reported "Explore Nearby card gets cut
   off" because the sidebar's overflow content (typically ~500px) wasn't
   discoverable as scrollable. Widened to 8px and bumped thumb opacity
   to ~0.30 with a darker hover state so the affordance is clear. */
.pal-guide-sidebar::-webkit-scrollbar { width: 8px; }
.pal-guide-sidebar::-webkit-scrollbar-track { background: transparent; }
.pal-guide-sidebar::-webkit-scrollbar-thumb {
  background: rgba(26,35,50,0.30);
  border-radius: 4px;
  transition: background 0.2s;
}
.pal-guide-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(26,35,50,0.50);
}
.pal-guide-sidebar { scrollbar-width: thin; scrollbar-color: rgba(26,35,50,0.30) transparent; }

.pal-toc {
  background: white; border-radius: var(--radius-lg); padding: var(--sp-6);
  border: var(--border-subtle); box-shadow: var(--shadow-sm);
}
.pal-toc h3 {
  font-family: var(--font-display); font-size: var(--heading-sm); font-weight: 600;
  color: var(--text-heading); margin-bottom: var(--sp-4);
}
.pal-toc ul { list-style: none; }
.pal-toc li { margin-bottom: 0.3rem; }
.pal-toc a {
  font-size: 0.8rem; color: var(--text-caption); text-decoration: none;
  padding: 0.55rem var(--sp-3); display: block; border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.pal-toc a:hover { color: var(--text-primary); background: rgba(45,95,63,0.04); }
.pal-toc a:focus-visible { outline: 2px solid var(--pal-green); outline-offset: 1px; }
.pal-toc a.active {
  color: var(--pal-green); font-weight: 500;
  border-left-color: var(--pal-green); background: rgba(45,95,63,0.04);
}

/* Sidebar widgets */
.pal-sidebar-widget {
  background: white; border-radius: var(--radius-lg); padding: var(--sp-6);
  border: var(--border-subtle); margin-top: var(--sp-6);
}
.pal-sidebar-widget h3 {
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 600;
  color: var(--text-heading); margin-bottom: var(--sp-2);
}
.pal-sidebar-widget p { font-size: var(--text-sm); color: var(--text-muted); line-height: var(--lh-normal); }

/* Ad placeholder */
.pal-ad-placeholder {
  text-align: center; padding: var(--sp-7) var(--sp-4); margin-top: var(--sp-6);
  border: 1px dashed rgba(26,35,50,0.08); border-radius: var(--radius-md);
  font-size: var(--text-tiny); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint);
}
.pal-ad-placeholder--inline {
  margin: var(--sp-7) 0; padding: var(--sp-6);
}

/* Valuation CTA */
.pal-valuation-cta {
  background: white; border-radius: var(--radius-lg); padding: var(--sp-6);
  border: 2px solid rgba(45,95,63,0.12); margin-top: var(--sp-6); text-align: center;
}
.pal-valuation-cta h3 {
  font-family: var(--font-display); font-size: var(--sp-4); font-weight: 600;
  color: var(--text-heading); margin-bottom: 0.3rem;
}
.pal-valuation-cta p {
  font-size: 0.8rem; color: var(--text-muted); margin-bottom: var(--sp-4);
}
.pal-valuation-cta .pal-btn {
  display: block; width: 100%;
}

/* ============================================================
   7. CONTENT SECTIONS — COMMON
   ============================================================ */
.pal-section { margin-bottom: var(--sp-9); scroll-margin-top: 5rem; }

.pal-guide.pal-guide .pal-section-title {
  font-family: var(--font-display); font-size: var(--heading-xl); font-weight: 600;
  color: var(--text-heading); letter-spacing: -0.02em; margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-2);
}
.pal-section-title .pal-section-icon {
  font-size: 1.1rem; opacity: 0.8;
}

/* Section-level text reset (inherits from the .pal-guide.pal-guide block above) */
.pal-guide.pal-guide .pal-section table:not(.pal-data-table):not(.pal-council-table) {
  width: 100%; border-collapse: collapse;
  margin-bottom: var(--sp-5); background: white;
  border-radius: var(--radius-sm); overflow: hidden;
  border: var(--border-subtle);
}
.pal-guide.pal-guide .pal-section table:not(.pal-data-table):not(.pal-council-table) th {
  font-weight: 600; text-align: left;
  padding: 0.6rem var(--sp-3); background: var(--pal-cream);
  border-bottom: var(--border-medium);
}
.pal-guide.pal-guide .pal-section table:not(.pal-data-table):not(.pal-council-table) td {
  padding: 0.6rem var(--sp-3);
  border-bottom: 1px solid rgba(26,35,50,0.05);
}
.pal-guide.pal-guide .pal-section table:not(.pal-data-table):not(.pal-council-table) tr:nth-child(even) {
  background: var(--pal-cream);
}

/* Section colour anchors (border-bottom on heading) */
.pal-section--executive .pal-section-title  { border-bottom: 3px solid var(--anchor-executive); }
.pal-section--prices .pal-section-title     { border-bottom: 3px solid var(--anchor-prices); }
.pal-section--schools .pal-section-title    { border-bottom: 3px solid var(--anchor-schools); }
.pal-section--transport .pal-section-title  { border-bottom: 3px solid var(--anchor-transport); }
.pal-section--crime .pal-section-title      { border-bottom: 3px solid var(--anchor-crime); }
.pal-section--council .pal-section-title    { border-bottom: 3px solid var(--anchor-council); }
.pal-section--community .pal-section-title  { border-bottom: 3px solid var(--anchor-community); }
.pal-section--verdict .pal-section-title    { border-bottom: 3px solid var(--anchor-verdict); }

/* Section photo */
.pal-section-photo {
  width: 100%; height: 240px; border-radius: var(--radius-md); overflow: hidden;
  margin-bottom: var(--sp-6); position: relative;
}
.pal-section-photo img {
  width: 100%; height: 100%; object-fit: cover; filter: saturate(1.05);
}
.pal-section-photo::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(26,35,50,0.2), transparent 40%);
}
.pal-section-photo-caption {
  position: absolute; bottom: var(--sp-3); left: var(--sp-4); z-index: 2;
  font-size: 0.68rem; color: var(--text-white-mid); font-style: italic;
}

/* Section banner — wide photo strip between heading and data */
.pal-section-banner {
  width: 100%; height: 190px; border-radius: var(--radius-md); overflow: hidden;
  margin-bottom: var(--sp-6); position: relative;
}
.pal-section-banner img {
  width: 100%; height: 100%; object-fit: cover;
}

/* Source citations */
.pal-source {
  font-size: var(--text-xxs); color: var(--text-faint); margin-top: var(--sp-4); font-style: italic;
}

/* ============================================================
   8. PROPERTY PRICES
   ============================================================ */
.pal-price-hero {
  background: white; border-radius: var(--radius-lg); padding: var(--sp-7); text-align: center;
  border: var(--border-subtle); margin-bottom: var(--sp-6);
  border-top: 4px solid var(--pal-gold);
}
.pal-price-hero .pal-price-val {
  font-family: var(--font-mono); font-size: var(--data-hero); font-weight: 600;
  color: var(--text-heading); letter-spacing: -0.03em;
}
.pal-price-hero .pal-price-lbl {
  font-size: var(--text-sm); font-weight: 600; color: var(--text-body); margin-top: var(--sp-1);
}

.pal-price-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); margin: var(--sp-6) 0;
}
.pal-price-card {
  background: white; border-radius: var(--radius-md); padding: var(--sp-6);
  border: var(--border-subtle); text-align: center;
  border-top: 3px solid rgba(45, 95, 63, 0.25);
  transition: transform 0.3s var(--ease-bounce), border-color 0.3s;
}
.pal-price-card:hover { transform: translateY(-2px); border-color: rgba(45,95,63,0.12); }
.pal-price-type {
  font-size: 0.8rem; font-weight: 600; color: var(--text-body);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--sp-2);
}
.pal-price-val {
  font-family: var(--font-mono); font-size: var(--data-lg); font-weight: 600;
  color: var(--text-heading); letter-spacing: -0.02em;
}
.pal-price-range {
  font-size: var(--text-xs); font-weight: 500; color: var(--text-body); margin-top: 0.4rem;
  display: flex; justify-content: space-between;
}
.pal-price-source {
  font-size: var(--text-xxs); color: var(--text-caption); margin-top: 1.2rem;
  text-align: right; font-style: italic;
}

/* Budget buys — Tabs */
.pal-budget-tabs { margin: var(--sp-4) 0 var(--sp-6); }
.pal-budget-tab-bar {
  display: flex; gap: 0; border-bottom: 2px solid rgba(26,35,50,0.08);
}
.pal-budget-tab {
  font-family: var(--font-mono); font-size: var(--data-sm); font-weight: 700;
  color: var(--text-caption); background: none; border: none; cursor: pointer;
  padding: 0.8rem 1.4rem; position: relative;
  transition: color 0.2s ease;
  white-space: nowrap;
}
.pal-budget-tab:hover { color: var(--pal-gold); }
.pal-budget-tab:focus-visible { outline: 2px solid var(--pal-gold); outline-offset: 2px; }
.pal-budget-tab.active {
  color: var(--pal-gold);
}
.pal-budget-tab.active::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 3px; background: var(--pal-gold); border-radius: 3px 3px 0 0;
}
.pal-budget-panel {
  display: none;
  padding: var(--sp-5) var(--sp-6);
  margin-top: var(--sp-4);
  background: #FEFEFE;
  border-radius: var(--radius-md);
}
.pal-budget-panel.active { display: block; }
.pal-budget-panel-text {
  font-size: var(--text-base); color: var(--text-body); line-height: var(--lh-relaxed);
}
.pal-budget-panel-text strong { color: var(--text-heading); }

/* ============================================================
   9. SCHOOLS
   ============================================================ */
/* Summary cards */
.pal-school-summary-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin: var(--sp-6) 0;
}
.pal-school-summary-card {
  border-radius: var(--radius-md); padding: var(--sp-5) var(--sp-6); color: white;
}
.pal-school-summary-card--primary { background: var(--pal-red); }
.pal-school-summary-card--secondary { background: var(--pal-blue); }
.pal-school-summary-card h4 {
  font-size: var(--text-sm); font-weight: 600; display: flex; align-items: center; gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.pal-school-summary-card .pal-school-count {
  font-size: 0.8rem; opacity: 0.9; display: flex; align-items: center; gap: 0.4rem;
}
.pal-school-count-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.pal-school-count-dot--outstanding { background: #d4a574; }
.pal-school-count-dot--good { background: rgba(255,255,255,0.5); }

/* Interactive map */
.pal-map-section { margin: var(--sp-6) 0; }
.pal-map-container {
  width: 100%; height: 420px; border-radius: var(--radius-lg); overflow: hidden;
  border: var(--border-light); box-shadow: var(--shadow-lg);
}
#palSchoolMap { width: 100%; height: 100%; }

.pal-map-filter-bar { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.pal-map-filter-btn {
  padding: 0.4rem 0.9rem; border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: 600;
  border: var(--border-medium); background: white; color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.pal-map-filter-btn:hover { border-color: rgba(45,95,63,0.3); color: var(--pal-green); }
.pal-map-filter-btn:focus-visible { outline: 2px solid var(--pal-green); outline-offset: 2px; }
.pal-map-filter-btn.active { background: var(--pal-green); color: white; border-color: var(--pal-green); }
.pal-map-filter-btn--primary.active { background: #c0392b; border-color: #c0392b; }
.pal-map-filter-btn--secondary.active { background: #2980b9; border-color: #2980b9; }
.pal-map-filter-btn--independent.active { background: var(--pal-gold); border-color: var(--pal-gold); color: var(--pal-navy); }
.pal-map-filter-btn:active { transform: scale(0.96); }

.pal-map-legend { display: flex; gap: 1.2rem; margin-top: var(--sp-4); flex-wrap: wrap; align-items: center; }
.pal-legend-item { display: flex; align-items: center; gap: 0.35rem; font-size: var(--text-xs); color: var(--text-muted); }
.pal-legend-divider { color: #ddd; font-size: var(--heading-sm); gap: 0; }
.pal-legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.pal-legend-dot--primary { background: #c0392b; }
.pal-legend-dot--secondary { background: #2980b9; }
.pal-legend-dot--independent { background: var(--pal-gold); }
.pal-legend-star { color: #2d5f3f; font-size: var(--text-sm); line-height: 1; }
.pal-legend-circle { color: var(--text-muted); font-size: 0.6rem; line-height: 1; }

/* Map marker icons */
.pal-marker-icon { background: none !important; border: none !important; }
.pal-map-marker--dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2.5px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.pal-map-marker--star {
  font-size: 1.375rem; line-height: 1;
  text-shadow: 0 0 3px white, 0 2px 4px rgba(0,0,0,0.3);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}

/* School cards — Two-column school listing */
.pal-school-columns {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); margin: var(--sp-6) 0;
}
.pal-school-column {
  border-radius: var(--radius-lg); padding: var(--sp-6); min-height: 120px;
}
.pal-school-column--primary {
  background: linear-gradient(160deg, rgba(192,57,43,0.08) 0%, rgba(255,255,255,0.95) 60%, #fff 100%);
  border: 1px solid rgba(192,57,43,0.12);
}
.pal-school-column--secondary {
  background: linear-gradient(160deg, rgba(41,128,185,0.08) 0%, rgba(255,255,255,0.95) 60%, #fff 100%);
  border: 1px solid rgba(41,128,185,0.12);
}
.pal-school-column-header {
  display: flex; align-items: center; gap: var(--sp-2);
  width: 100%; margin-bottom: 0; padding: var(--sp-3) 0.9rem;
  border: none; border-bottom: 2px solid rgba(0,0,0,0.06);
  background: transparent; cursor: pointer;
  transition: background 0.2s;
}
.pal-school-column-header:hover { background: rgba(26,35,50,0.03); }
.pal-school-column-header:focus-visible { outline: 2px solid var(--pal-green); outline-offset: 2px; }
.pal-school-column-title {
  display: flex; align-items: center; gap: var(--sp-2); flex: 1;
}
.pal-school-chevron {
  flex-shrink: 0; color: var(--text-muted);
  transition: transform 0.25s ease;
}
.pal-school-column-header[aria-expanded="true"] .pal-school-chevron {
  transform: rotate(180deg);
}
.pal-school-column--primary .pal-school-column-header { border-bottom-color: rgba(192,57,43,0.2); }
.pal-school-column--secondary .pal-school-column-header { border-bottom-color: rgba(41,128,185,0.2); }
.pal-school-column-header h4 {
  font-family: var(--font-display); font-size: var(--sp-4); font-weight: 700;
  color: var(--text-heading); margin: 0;
}
.pal-school-column--primary .pal-school-column-header h4 { color: #c0392b; }
.pal-school-column--secondary .pal-school-column-header h4 { color: #2980b9; }
.pal-school-column-count {
  font-size: 0.7rem; font-weight: 600; padding: 0.15rem var(--sp-2);
  border-radius: var(--radius-pill); color: white; margin-left: auto;
}
.pal-school-column--primary .pal-school-column-count { background: #c0392b; }
.pal-school-column--secondary .pal-school-column-count { background: #2980b9; }

.pal-school-column-list {
  display: flex; flex-direction: column; gap: 0.6rem;
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0;
}
.pal-school-column-list.open {
  max-height: 2000px;
  padding-top: var(--sp-3);
}
.pal-school-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 0.9rem; border-radius: 10px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(0,0,0,0.04);
  transition: transform 0.2s var(--ease-bounce), box-shadow 0.2s;
  cursor: pointer;
}
.pal-school-row:hover { transform: translateX(3px); box-shadow: 0 3px 12px rgba(26,35,50,0.06); }
.pal-school-row:focus-visible { outline: 2px solid var(--pal-green); outline-offset: 2px; }
.pal-school-row-info h5 {
  font-family: var(--font-display); font-size: 0.88rem; font-weight: 600;
  color: var(--text-heading); margin: 0 0 0.15rem;
}
.pal-school-row-meta { font-size: var(--text-xxs); color: var(--text-caption); }
.pal-ofsted-badge {
  padding: var(--sp-1) 0.65rem; border-radius: var(--radius-pill);
  font-size: var(--text-tiny); font-weight: 600; white-space: nowrap; color: white;
  flex-shrink: 0;
}
.pal-ofsted-outstanding { background: var(--pal-green); }
.pal-ofsted-good { background: var(--pal-blue); }
.pal-ofsted-excellent { background: var(--pal-gold); }
.pal-ofsted-ri { background: var(--text-caption); }
.pal-school-column-empty {
  text-align: center; padding: var(--sp-6); color: var(--text-faint);
  font-size: var(--text-sm); font-style: italic;
}

/* Custom Leaflet popup styling — !important needed (third-party library) */
.pal-guide .leaflet-popup-content-wrapper {
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-xl) !important;
  border: var(--border-light) !important;
  font-family: var(--font-body) !important;
}
.pal-guide .leaflet-popup-content { margin: 14px 16px !important; }
.pal-school-popup-name {
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  color: var(--text-heading); margin-bottom: var(--sp-1);
}
.pal-school-popup-meta { font-size: var(--text-xs); color: var(--text-caption); line-height: var(--lh-normal); }
.pal-school-popup-badge {
  display: inline-block; padding: 0.15rem var(--sp-2); border-radius: 6px;
  font-size: var(--text-tiny); font-weight: 600; margin-top: 0.35rem; color: white;
}

/* ============================================================
   10. TRANSPORT & COMMUTE
   ============================================================ */
.pal-station-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin: var(--sp-6) 0;
}
.pal-station-grid--single { grid-template-columns: 1fr; }
.pal-station-card {
  background: var(--pal-navy); border-radius: var(--radius-md); padding: var(--sp-6);
  color: white;
}
.pal-station-card--train {
  background: linear-gradient(135deg, #2d5f3f, #3a7a50);
}
.pal-station-label {
  font-size: var(--text-tiny); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-white-low);
  display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2);
}
.pal-station-name {
  font-family: var(--font-display); font-size: var(--heading-lg); font-weight: 600;
  margin-bottom: 0.4rem;
}
.pal-station-line {
  font-size: var(--text-sm); color: rgba(255,255,255,0.6); margin-bottom: var(--sp-3);
}
.pal-transport-lines { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: var(--sp-2); }
.pal-line-badge {
  padding: 0.2rem 0.6rem; border-radius: 6px;
  font-size: var(--text-tiny); font-weight: 600; color: white;
}
.pal-zone-badge {
  background: rgba(74,124,140,0.15); color: var(--pal-blue);
  padding: var(--sp-1) 0.6rem; border-radius: 6px;
  font-size: var(--text-xxs); font-weight: 600;
}

/* Commute time cards */
.pal-commute-heading {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 600;
  color: var(--text-heading); margin: var(--sp-7) 0 var(--sp-4);
}
.pal-commute-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin: var(--sp-4) 0;
}
.pal-commute-card {
  background: white; border-radius: var(--radius-md); padding: var(--sp-5) var(--sp-4);
  border: var(--border-subtle); text-align: center;
  transition: transform 0.25s var(--ease-bounce);
  position: relative; overflow: hidden;
}
.pal-commute-card:hover { transform: translateY(-2px); }
.pal-commute-time {
  font-family: var(--font-mono); font-size: var(--data-md); font-weight: 600;
  color: var(--text-heading); margin-bottom: 0.2rem;
}
.pal-commute-dest {
  font-size: var(--text-sm); color: var(--text-body); font-weight: 600; margin-bottom: 0.15rem;
}
.pal-commute-route {
  font-size: var(--text-xxs); color: #7a8a92; font-weight: 500;
}
.pal-commute-line-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 5px; border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ============================================================
   11. CRIME & SAFETY — Signal Dashboard + Expandable Table
   ============================================================ */

/* Signal Grid (4 cards) */
.pal-signal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin: var(--sp-6) 0;
}
.pal-signal-card {
  background: white;
  border-radius: var(--radius-md);
  padding: var(--sp-6);
  text-align: center;
  border: var(--border-subtle);
  border-top: 4px solid transparent;
  transition: transform 0.25s var(--ease-bounce);
  position: relative;
  overflow: hidden;
}
.pal-signal-card:hover { transform: translateY(-2px); }
.pal-signal-card.green { border-top-color: var(--pal-signal-green); }
.pal-signal-card.amber { border-top-color: var(--pal-signal-amber); }
.pal-signal-card.red   { border-top-color: var(--pal-signal-red); }

.pal-signal-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  margin: 0 auto var(--sp-2);
}
.green .pal-signal-dot { background: var(--pal-signal-green); box-shadow: 0 0 8px rgba(61,124,74,0.4); }
.amber .pal-signal-dot { background: var(--pal-signal-amber); box-shadow: 0 0 8px rgba(230,162,60,0.4); }
.red   .pal-signal-dot { background: var(--pal-signal-red);   box-shadow: 0 0 8px rgba(216,81,73,0.4); }

.pal-signal-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text-heading);
  line-height: var(--lh-tight);
}
.pal-signal-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--sp-1);
  line-height: 1.3;
}
.pal-signal-detail {
  font-size: var(--text-xxs);
  color: var(--text-caption);
  margin-top: 4px;
}

/* Context Strip */
.pal-context-strip {
  background: #ffffff;
  border: var(--border-medium);
  border-radius: var(--radius-sm);
  padding: var(--sp-6);
  display: flex;
  gap: var(--sp-7);
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}
.pal-top-concern { flex: 1; min-width: 180px; }
.pal-top-concern h3 {
  font-size: var(--text-xxs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-caption);
  margin-bottom: var(--sp-1);
  font-weight: 600;
}
.pal-concern-name {
  font-family: var(--font-display);
  font-size: var(--heading-md);
  font-weight: 600;
  color: var(--text-heading);
}
.pal-concern-pct {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.pal-interpretation {
  flex: 2.5;
  min-width: 260px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: var(--lh-normal);
}

/* Expandable Detail Section */
.pal-data-expandable {
  background: #ffffff;
  border: var(--border-medium);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: var(--sp-4);
}
.pal-expand-header {
  width: 100%;
  background: var(--pal-cream);
  border: none;
  padding: var(--sp-4) var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-heading);
  transition: background 0.2s;
}
.pal-expand-header:hover { background: rgba(26,35,50,0.06); }
.pal-expand-header:focus-visible { outline: 2px solid var(--pal-green); outline-offset: -2px; }
.pal-expand-header svg {
  transition: transform 0.25s ease;
  color: var(--text-muted);
}
.pal-expand-header[aria-expanded="true"] svg { transform: rotate(180deg); }

.pal-expand-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.pal-expand-body.open { max-height: 1400px; }
.pal-expand-body-inner { padding: var(--sp-6); }

.pal-table-intro {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
  line-height: var(--lh-normal);
}

/* Data Table with colour coding */
.pal-data-table {
  width: 100%;
  border-collapse: collapse;
}
.pal-data-table th {
  text-align: left;
  font-size: var(--text-xxs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-caption);
  padding: var(--sp-1) var(--sp-2);
  border-bottom: 2px solid rgba(26,35,50,0.1);
}
.pal-data-table th:nth-child(2),
.pal-data-table th:nth-child(3) { text-align: right; }
.pal-data-table th:nth-child(4) { text-align: left; padding-left: var(--sp-4); }
.pal-data-table tbody tr:nth-child(even) {
  background: var(--pal-cream);
}
.pal-data-table td {
  padding: var(--sp-2);
  font-size: var(--text-sm);
  border-bottom: 1px solid rgba(26,35,50,0.05);
}
.pal-data-table td:first-child { color: var(--text-muted); }
.pal-data-table td:nth-child(2),
.pal-data-table td:nth-child(3) {
  font-family: var(--font-mono);
  color: var(--text-heading);
  text-align: right;
}
.pal-data-table td:nth-child(3) { color: var(--text-muted); }
.pal-data-table td:nth-child(4) { padding-left: var(--sp-4); }

/* Summary row */
.pal-summary-row td {
  border-top: 2px solid rgba(26,35,50,0.1);
  font-weight: 600;
}

/* Verdict pills */
.pal-verdict {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.pal-verdict.green {
  background: rgba(61,124,74,0.1);
  color: var(--pal-signal-green);
}
.pal-verdict.amber {
  background: rgba(230,162,60,0.1);
  color: var(--pal-signal-amber);
}
.pal-verdict.red {
  background: rgba(216,81,73,0.1);
  color: var(--pal-signal-red);
}

/* Methodology note */
.pal-methodology-note {
  font-size: var(--text-xs);
  color: var(--text-caption);
  margin-top: var(--sp-6);
  line-height: 1.65;
  padding-top: var(--sp-4);
  border-top: 1px solid rgba(26,35,50,0.06);
}
.pal-methodology-note strong { color: var(--text-muted); }

/* ============================================================
   12. COUNCIL FEES
   ============================================================ */
.pal-council-authority {
  font-size: var(--text-base); color: var(--text-muted); margin-bottom: var(--sp-6);
}
.pal-council-authority strong { color: var(--text-heading); }

.pal-council-table {
  width: 100%; border-collapse: collapse; margin: var(--sp-4) 0;
  background: white; border-radius: var(--radius-md); overflow: hidden;
  border: var(--border-subtle);
}
.pal-council-table th {
  font-size: var(--text-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-caption); padding: var(--sp-4);
  background: var(--pal-cream); text-align: center;
  border-bottom: var(--border-light);
}
.pal-council-table td {
  font-family: var(--font-mono); font-size: var(--sp-4); font-weight: 600;
  color: var(--text-heading); padding: var(--sp-4); text-align: center;
}

.pal-parking-section { margin-top: var(--sp-6); }
.pal-parking-section h4 {
  font-family: var(--font-display); font-size: var(--heading-md); font-weight: 600;
  color: var(--text-heading); margin-bottom: var(--sp-4);
}
.pal-parking-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4);
}
.pal-parking-item {
  font-size: 0.88rem; color: var(--text-muted);
}
.pal-parking-item strong {
  display: block; color: var(--text-heading); margin-bottom: 0.1rem;
}
.pal-cpz-info {
  margin-top: var(--sp-4); font-size: 0.88rem; color: var(--text-muted);
}
.pal-cpz-info strong { color: var(--text-heading); }

/* ============================================================
   13. COMMUNITY CHARACTER — v3.5 (Filmstrip Gallery + 2×2 Panel Grid)
   ============================================================ */

/* Stacked layout: horizontal gallery row on top, 2×2 panel grid below */
.pal-comm-layout {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

/* 2×2 editorial panel grid (bottom section of community layout) */
.pal-comm-panels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}

/* Editorial panels — colour-coded left borders unchanged */
.pal-comm-panel {
  padding: 1.4rem var(--sp-6);
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 0; /* gap on .pal-comm-panels handles spacing in the 2×2 grid */
  border-left: 4px solid transparent;
}
.pal-comm-panel--vibe    { border-left-color: var(--pal-blue); }
.pal-comm-panel--love    { border-left-color: var(--pal-green); }
.pal-comm-panel--know    { border-left-color: var(--pal-red); }
.pal-comm-panel--seasons { border-left-color: var(--pal-gold); }
.pal-comm-panel--seasons .pal-comm-panel-text { font-size: var(--text-sm); line-height: 1.7; }

.pal-comm-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--sp-1) 0.7rem;
  border-radius: 4px;
  margin-bottom: var(--sp-2);
}
.pal-comm-badge--vibe    { background: rgba(74,124,140,0.12); color: var(--pal-blue);  }
.pal-comm-badge--love    { background: rgba(45,95,63,0.12);  color: var(--pal-green); }
.pal-comm-badge--know    { background: rgba(196,69,54,0.1);  color: var(--pal-red);   }
.pal-comm-badge--seasons { background: rgba(212,165,116,0.16); color: #8a6a3d;         }

.pal-comm-headline {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 700; line-height: var(--lh-snug);
  color: var(--text-heading);
  margin: var(--sp-2) 0 0.6rem;
}

.pal-comm-panel-text {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-body);
}
.pal-comm-panel-text strong { color: var(--text-heading); font-weight: 600; }

/* Panel 3 (Five Places): subtle separator between venue entries */
.pal-comm-panel--know .pal-comm-panel-text p {
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 0.7rem;
}
.pal-comm-panel--know .pal-comm-panel-text p:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* Inner text inherits from .pal-guide.pal-guide global reset */
.pal-comm-panel-text p:last-child,
.pal-comm-panel-text li:last-child { margin-bottom: 0; }

/* Community panel tables */
.pal-guide.pal-guide .pal-comm-panel-text table {
  width: 100%; border-collapse: collapse;
  margin-bottom: var(--sp-3); background: white;
  border-radius: var(--radius-sm); overflow: hidden;
  border: var(--border-subtle);
}
.pal-guide.pal-guide .pal-comm-panel-text th {
  font-weight: 600; text-align: left;
  padding: var(--sp-2) var(--sp-3); background: var(--pal-cream);
  border-bottom: var(--border-medium);
}
.pal-guide.pal-guide .pal-comm-panel-text td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid rgba(26,35,50,0.05);
}
.pal-guide.pal-guide .pal-comm-panel-text tr:nth-child(even) {
  background: var(--pal-cream);
}

/* Photo gallery — v3.6: filmstrip + optional 3-visible carousel (≤3 tiles = static row; >3 = scrollable carousel with arrows) */

/* Wrapper positions the arrow buttons against the track. */
.pal-comm-gallery-wrap {
  position: relative;
}

/* Static row (1–3 images) — no carousel, fill the row edge-to-edge. */
.pal-comm-gallery--row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;    /* equal widths for up to 3 tiles */
  gap: 0.6rem;
}

/* Carousel variant (>3 images) — switch from grid to flex so we can
   give each tile a fixed "1/3 of the viewport" basis and scroll the rest
   off-screen. Snap-aligned so clicks always come to rest on a tile. */
.pal-comm-gallery--carousel {
  display: flex;
  grid-auto-flow: unset;
  grid-auto-columns: unset;
  gap: 0.6rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;     /* Firefox */
  -ms-overflow-style: none;  /* IE/old Edge */
  /* Nudge the track to give the arrow buttons room to float over it. */
  padding: 2px 0;
}
.pal-comm-gallery--carousel::-webkit-scrollbar { display: none; }

/* Each tile in carousel mode = exactly 1/3 of the visible width (minus gaps). */
.pal-comm-gallery--carousel .pal-comm-photo {
  flex: 0 0 calc((100% - 2 * 0.6rem) / 3);
  scroll-snap-align: start;
}

/* Shared tile styling (applies to both row and carousel variants). */
.pal-comm-photo {
  position: relative;
  display: block;
  height: 220px;             /* uniform height for clean filmstrip */
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pal-comm-photo:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.pal-comm-photo:focus-visible {
  outline: 3px solid var(--pal-blue);
  outline-offset: 2px;
}
.pal-comm-photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(1.05);
}

/* Carousel prev/next arrow buttons — float over the tiles at vertical centre. */
.pal-gal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  color: var(--text-heading);
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.pal-gal-arrow--prev { left: -10px; }
.pal-gal-arrow--next { right: -10px; }
.pal-gal-arrow:hover:not(:disabled) {
  background: #fff;
  transform: translateY(-50%) scale(1.06);
}
.pal-gal-arrow:focus-visible {
  outline: 3px solid var(--pal-blue);
  outline-offset: 2px;
}
.pal-gal-arrow:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* ============================================================
   14. EDITORIAL VERDICT — Two-Column Banner + Mini Arc Gauges
   ============================================================ */

/* Verdict Banner (Liquid Glass Card) — three-zone colour */
.pal-verdict-banner {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #46707f;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.15),
    inset 0 -1px 0 rgba(0,0,0,0.08);
  max-width: 800px;
  margin: 0 auto 0;
}
/* Diagonal light gradient overlay */
.pal-verdict-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(225deg,
    rgba(255,255,255,0.10) 0%,
    rgba(255,255,255,0.04) 30%,
    transparent 55%,
    rgba(255,255,255,0.03) 80%,
    rgba(255,255,255,0.06) 100%);
  pointer-events: none; z-index: 1;
}

/* Top zone: lighter (#538392) */
.pal-vb-top {
  display: flex;
  align-items: center;
  padding: 1.8rem var(--sp-7) 0.8rem;
  position: relative; z-index: 2;
  background: #538392;
}
.pal-vb-logo {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: 10px; object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
  margin-right: var(--sp-4);
}
.pal-vb-top-text {
  flex: 1; text-align: center;
  padding-right: 52px;
}
.pal-vb-subtitle {
  font-family: var(--font-display);
  font-size: var(--data-sm); font-weight: 500;
  color: #fff; opacity: 0.7;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}
.pal-vb-divider {
  width: 60px; height: 2px;
  background: var(--pal-red);
  margin: 0 auto var(--sp-2);
  opacity: 0.7;
}
.pal-vb-neighbourhood {
  font-family: var(--font-display);
  font-size: 2.4rem; font-weight: 800; color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Stacked body: middle zone, darker (#46707f — the banner base) */
.pal-vb-body {
  display: flex; flex-direction: column;
  align-items: center;
  padding: 1.2rem var(--sp-7) 1.8rem;
  position: relative; z-index: 2;
}
.pal-vb-gauge {
  position: relative;
  width: 260px; height: 155px;
  margin-bottom: 0.3rem;
}
.pal-vb-gauge svg { width: 100%; height: 100%; }
.pal-vb-score {
  position: absolute; bottom: 8px; left: 50%;
  transform: translateX(-50%); text-align: center;
}
.pal-vb-number {
  font-family: var(--font-display);
  font-size: 3.6rem; font-weight: 800;
  color: var(--pal-red); line-height: 1; letter-spacing: -0.04em;
}
.pal-vb-decimal { font-size: 2.6rem; letter-spacing: -0.02em; }
.pal-vb-outof {
  display: block; font-size: var(--data-sm);
  color: var(--text-white-mid); font-weight: 500;
  margin-top: 0.15rem; letter-spacing: 0.04em;
}
.pal-vb-verdict-label {
  font-family: var(--font-display);
  font-size: var(--heading-md); font-weight: 700;
  color: var(--pal-red); text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.8rem;
}

/* Audience tags (centred below gauge) */
.pal-vb-audience-tags {
  display: flex; gap: 0.6rem; flex-wrap: wrap;
  justify-content: center;
}
.pal-vb-audience-tag {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px; padding: 0.55rem 1.3rem;
  font-size: var(--sp-4); color: var(--text-white-high);
  backdrop-filter: blur(8px);
}
.pal-vb-tag-score {
  font-weight: 700; font-family: var(--font-mono);
  font-size: 1.1rem; color: var(--pal-red);
}

/* Editorial panel: bottom zone, lighter (#538392) */
.pal-vb-editorial {
  padding: 1.6rem 2.2rem 1.8rem;
  position: relative; z-index: 2;
  background: #538392;
}
.pal-vb-editorial h3 {
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 700; color: #fff;
  margin-bottom: 0.6rem; line-height: 1.3;
}
.pal-verdict-banner .pal-vb-editorial p {
  font-size: var(--text-base); line-height: 1.65;
  color: rgba(255,255,255,0.85);
}

/* Mini arc gauges row (below banner) */
.pal-gauges-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-4);
  background: var(--pal-cream);
  border-radius: 16px;
  padding: 1.8rem 1.2rem;
  border: 1px solid rgba(0,0,0,0.06);
  margin-top: 0.8rem;
  max-width: 800px;
  margin-left: auto; margin-right: auto;
}
.pal-gauge-item {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
}
.pal-gauge-icon { font-size: 1.1rem; margin-bottom: 0.2rem; }
.pal-gauge-svg-wrap {
  position: relative;
  width: 110px; height: 70px;
  margin-bottom: var(--sp-2);
}
.pal-gauge-svg-wrap svg { width: 100%; height: 100%; }
.pal-gauge-score-num {
  position: absolute; bottom: 2px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: var(--heading-lg); font-weight: 800;
  letter-spacing: -0.03em;
}
.pal-gauge-decimal {
  font-size: var(--sp-4); letter-spacing: -0.01em;
}
.pal-gauge-label {
  font-size: var(--text-xs); font-weight: 600;
  color: var(--text-heading);
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* Detail cards below the banner */
.pal-verdict-details {
  max-width: 800px; margin: var(--sp-7) auto 0;
  color: var(--text-body);
}
.pal-verdict-details * {
  color: inherit;
}
.pal-verdict-details h3, .pal-verdict-details h4 {
  color: var(--text-heading);
}
.pal-verdict-details strong {
  color: var(--text-heading); font-weight: 600;
}
.pal-verdict-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); margin-bottom: var(--sp-6);
}
.pal-verdict-col h3 {
  font-size: var(--text-sm); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: var(--sp-3); color: var(--text-heading);
}
.pal-verdict-col p, .pal-verdict-col div {
  font-size: 0.88rem; line-height: 1.7; color: var(--text-body);
}
.pal-verdict-narrative {
  padding: var(--sp-6) 0; border-top: 1px solid rgba(26,35,50,0.08);
}
.pal-verdict-narrative h4 {
  font-family: var(--font-display); font-size: var(--heading-md); font-weight: 600;
  color: var(--text-heading); margin-bottom: var(--sp-4);
}
.pal-verdict-narrative p, .pal-verdict-narrative div {
  font-size: var(--text-base); line-height: var(--lh-relaxed); color: var(--text-body);
}
.pal-verdict-narrative strong, .pal-verdict-details strong {
  color: var(--text-heading); font-weight: 600;
}
.pal-verdict-rec {
  padding-top: var(--sp-6); border-top: 2px solid var(--pal-gold); margin-top: var(--sp-2);
}
.pal-verdict-rec h4 {
  font-size: var(--text-sm); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--pal-gold); margin-bottom: var(--sp-3);
}
.pal-verdict-rec p, .pal-verdict-rec div {
  font-size: var(--sp-4); line-height: var(--lh-relaxed); color: var(--text-heading);
}

/* ============================================================
   14a-iv. EDITORIAL VERDICT BLOCK (v2.11.0, May 2026)
   ============================================================
   The "Who's {Name} for?" gated dark card reads from the
   audience_fit_detail ACF field after the v3.4.0 template flip.
   Wrapper: .pal-verdict-narrative.pal-verdict-editorial.

   Visual hierarchy (deliberate inversion of HTML hierarchy):
     - h3 section label = restrained, matching Future Outlook /
       Value Assessment h4 style above (Spectral 600 /
       heading-md). It's a quiet shelf label, not the headline.
     - h4 advisory headings = the actual content shelves
       ("{Area} is likely to suit you if:", "Look elsewhere if
       you:", "The Real Picture"). Promoted to heading-lg with
       deliberate vertical rhythm so each conditional block
       reads as its own distinct sub-section.
   ============================================================ */
.pal-verdict-editorial h3 {
  font-family: var(--font-display);
  font-size: var(--heading-md);
  font-weight: 600;
  color: var(--text-heading);
  margin-top: 0;
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3);
}

.pal-verdict-editorial h4 {
  font-family: var(--font-display);
  font-size: var(--heading-lg);
  font-weight: 600;
  color: var(--text-heading);
  margin-top: var(--sp-7);
  margin-bottom: var(--sp-4);
  line-height: var(--lh-tight, 1.25);
}

/* First h4 sits flush against the h3 above — the h3's
   padding-bottom + margin-bottom already created the gap. */
.pal-verdict-editorial h3 + h4 {
  margin-top: var(--sp-3);
}

/* ============================================================
   14a-ii. PAL SCORE EXPLANATION
   Bug Report #5: First paragraph needs visual weight as the
   introductory hook for the score breakdown.
   ============================================================ */
.pal-score-explanation > p:first-of-type {
  font-weight: 700;
  font-size: 1.125em;
  line-height: var(--lh-normal);
}

/* ============================================================
   14a-iii. NARRATIVE SUB-HEADINGS (H4)
   ============================================================
   v2.9.2 (11 May 2026) — Bug report 11 May.
   The 6 narrative ACF wrappers (property/transport/crime/council/
   moving-practicalities/score-explanation) emit H4 sub-headings
   inside long-form prose. Without a base rule, browsers gave them
   margin-top: 0 and body inherited Inter at weight 400 — so the
   H4s read as "slightly bigger body text" rather than "new sub-
   topic". Apply the Spectral/600 treatment used elsewhere in the
   heading system, plus deliberate vertical rhythm (32px above,
   12px below — parent-child spacing per the lexicon hierarchy
   chapter). Component H4s in school cards, verdict panels etc.
   are untouched because they use their own scoped rules. */
.pal-property-narrative h4,
.pal-transport-narrative h4,
.pal-crime-narrative h4,
.pal-council-narrative h4,
.pal-moving-practicalities h4,
.pal-score-explanation h4 {
  font-family: var(--font-display);
  font-size: var(--heading-md);
  font-weight: 600;
  color: var(--text-heading);
  line-height: var(--lh-snug);
  margin-top: var(--sp-7);    /* 32px — clear separation from preceding paragraph */
  margin-bottom: var(--sp-3); /* 12px — tight to following paragraph (signals parent-of) */
}
/* First narrative H4 doesn't need the big margin-top — section title or
   intro paragraph already provides the gap above. Keeps the rhythm clean. */
.pal-property-narrative > h4:first-child,
.pal-transport-narrative > h4:first-child,
.pal-crime-narrative > h4:first-child,
.pal-council-narrative > h4:first-child,
.pal-moving-practicalities > h4:first-child,
.pal-score-explanation > h4:first-child {
  margin-top: 0;
}

/* ============================================================
   14b. FAQs ACCORDION
   ============================================================ */
.pal-section--faqs .pal-section-title {
  border-bottom: 3px solid var(--pal-blue);
}
.pal-faq-intro {
  font-size: 0.88rem; color: var(--text-body); line-height: var(--lh-normal); margin-bottom: var(--sp-6);
}
.pal-faq-list {
  display: flex; flex-direction: column; gap: 0;
}
.pal-faq-item {
  border-bottom: 1px solid rgba(26,35,50,0.08);
}
.pal-faq-item:first-child {
  border-top: 1px solid rgba(26,35,50,0.08);
}
.pal-faq-question {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 1.1rem 0; border: none; background: transparent;
  font-family: var(--font-display); font-size: var(--sp-4); font-weight: 600;
  color: var(--text-heading); text-align: left; cursor: pointer;
  line-height: 1.45; gap: var(--sp-4);
  transition: color 0.2s ease;
}
.pal-faq-question:hover { color: var(--pal-blue); }
.pal-faq-question:focus-visible {
  outline: 2px solid var(--pal-blue); outline-offset: 2px; border-radius: 4px;
}
.pal-faq-icon {
  flex-shrink: 0; width: 20px; height: 20px; position: relative;
}
.pal-faq-icon::before,
.pal-faq-icon::after {
  content: ''; position: absolute; background: var(--pal-navy);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pal-faq-icon::before {
  top: 50%; left: 0; width: 100%; height: 2px; transform: translateY(-50%);
}
.pal-faq-icon::after {
  top: 0; left: 50%; width: 2px; height: 100%; transform: translateX(-50%);
}
.pal-faq-item--open .pal-faq-icon::after {
  transform: translateX(-50%) rotate(90deg);
}
.pal-faq-answer {
  overflow: hidden; padding: 0 0 var(--sp-5) 0;
}
.pal-faq-answer[hidden] { display: none; }
.pal-guide.pal-guide .pal-faq-answer p {
  font-size: var(--text-base); line-height: var(--lh-relaxed); color: var(--text-body); margin: 0;
}

/* ============================================================
   15. CTA & NEWSLETTER
   ============================================================ */
.pal-cta {
  background: white; border-radius: var(--radius-lg); padding: var(--sp-7);
  border: var(--border-subtle); text-align: center; margin-top: var(--sp-7);
}
.pal-cta h3 {
  font-family: var(--font-display); font-size: var(--data-sm); font-weight: 600;
  color: var(--text-heading); margin-bottom: var(--sp-2);
}
.pal-cta p { font-size: var(--text-sm); color: var(--text-caption); margin-bottom: var(--sp-5); line-height: var(--lh-normal); }
.pal-cta-form {
  display: flex; max-width: 400px; margin: 0 auto;
  background: var(--pal-cream); border-radius: 10px; padding: 0.3rem;
}
.pal-cta-form input {
  flex: 1; background: transparent; border: none; outline: none;
  padding: 0.6rem 0.8rem; font-size: var(--text-sm); font-family: var(--font-body);
  color: var(--text-primary);
}
.pal-cta-form input::placeholder { color: var(--text-faint); }
.pal-cta-form button {
  background: var(--pal-green); color: white; border: none;
  padding: 0.6rem 1.2rem; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.8rem;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.2s var(--ease-bounce);
}
.pal-cta-form button:hover { transform: scale(1.04); }
.pal-cta-form button:active { transform: scale(0.97); }
.pal-cta-form button:focus-visible { outline: 2px solid var(--pal-gold); outline-offset: 2px; }
.pal-cta-small { font-size: var(--text-xxs); color: var(--text-faint); margin-top: var(--sp-3); }

/* Affiliate CTA banner */
.pal-affiliate-cta {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--pal-green); border-radius: var(--radius-md); padding: var(--sp-5) var(--sp-7);
  margin: var(--sp-6) 0; color: white; flex-wrap: wrap; gap: var(--sp-4);
}
.pal-affiliate-cta-text h4 {
  font-family: var(--font-display); font-size: var(--sp-4); font-weight: 600;
  margin-bottom: var(--sp-3);
}
.pal-affiliate-cta-text p {
  font-size: 0.8rem; color: var(--text-white-mid); margin: 0;
}
.pal-affiliate-cta .pal-btn--outline {
  background: transparent; color: white; border: 1.5px solid rgba(255,255,255,0.4);
  padding: var(--sp-2) 1.2rem; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.8rem;
  cursor: pointer; text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.pal-affiliate-cta .pal-btn--outline:hover {
  background: rgba(255,255,255,0.1); border-color: white;
}

/* ============================================================
   16. FEATURED LOCAL SERVICES
   ============================================================ */
.pal-services-heading {
  text-align: center; margin-bottom: 0.3rem;
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 600;
  color: var(--text-heading);
}
.pal-services-sub {
  text-align: center; font-size: 0.8rem; color: var(--text-caption); margin-bottom: var(--sp-6);
}
.pal-services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-3);
}
.pal-service-card {
  background: white; border-radius: var(--radius-md); padding: var(--sp-6);
  border: var(--border-subtle); text-align: center;
  transition: transform 0.25s var(--ease-bounce);
}
.pal-service-card:hover { transform: translateY(-3px); }
.pal-service-icon { font-size: var(--data-lg); margin-bottom: var(--sp-3); color: var(--pal-green); }
.pal-service-title {
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 600;
  color: var(--text-heading); margin-bottom: 0.3rem;
}
.pal-service-desc { font-size: var(--text-xs); color: var(--text-caption); margin-bottom: var(--sp-4); }
.pal-service-link {
  font-size: 0.8rem; font-weight: 600; color: var(--pal-green);
  text-decoration: none; transition: color 0.2s;
}
.pal-service-link:hover { color: var(--pal-navy); }
.pal-services-disclaimer {
  text-align: center; font-size: 0.68rem; color: var(--text-faint); font-style: italic;
}

/* ============================================================
   17. BUTTONS
   ============================================================ */
.pal-btn {
  display: inline-block; padding: 0.7rem var(--sp-6); border-radius: var(--radius-sm);
  font-weight: 600; font-size: var(--text-sm); text-decoration: none; text-align: center;
  cursor: pointer; border: none;
  transition: transform 0.2s var(--ease-bounce), box-shadow 0.2s;
}
.pal-btn:hover { transform: translateY(-1px); }
.pal-btn:active { transform: translateY(0); }
.pal-btn:focus-visible { outline: 2px solid var(--pal-gold); outline-offset: 2px; }
.pal-btn--green { background: var(--pal-green); color: white; }
.pal-btn--green:hover { box-shadow: 0 4px 12px rgba(45,95,63,0.2); }
.pal-btn--navy { background: var(--pal-navy); color: white; }

/* ============================================================
   18. FOOTER
   ============================================================ */
.pal-guide-footer {
  background: var(--pal-navy); color: rgba(248,246,241,0.4);
  padding: var(--sp-8) var(--sp-7); font-size: 0.8rem; margin-top: var(--sp-9);
}
.pal-guide-footer a {
  color: rgba(248,246,241,0.6); text-decoration: none; transition: color 0.2s;
}
.pal-guide-footer a:hover { color: var(--pal-gold); }
.pal-footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--sp-4);
}
.pal-footer-logo {
  font-family: var(--font-display); font-weight: 600;
  color: rgba(248,246,241,0.8); font-size: var(--sp-4);
}
.pal-footer-links { display: flex; gap: var(--sp-6); }

/* ============================================================
   19. NARRATIVE BLOCK (extracted from inline styles in PHP)
   ============================================================ */
.pal-narrative-block {
  background: #ffffff;
  padding: var(--sp-7);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-top: var(--sp-6);
}

/* ============================================================
   20. SCROLL REVEAL ANIMATION
   ============================================================ */
.pal-reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s var(--ease-smooth), transform 0.6s var(--ease-smooth);
}
.pal-reveal.visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   21. RESPONSIVE
   ============================================================
   Three breakpoints only:
     900px — desktop sidebar collapses, main grids simplify
     768px — tablet: 2-col grids → 1-col
     480px — phone: remaining multi-col grids → 1-col
   ============================================================ */

/* ── Desktop → tablet (≤ 900px) ── */
@media (max-width: 900px) {
  .pal-guide-layout { grid-template-columns: 1fr; padding: var(--sp-7) var(--sp-4); }
  .pal-guide-sidebar { display: none; }
  .pal-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .pal-price-grid { grid-template-columns: 1fr; }
  .pal-station-grid { grid-template-columns: 1fr; }
  .pal-commute-grid { grid-template-columns: repeat(2, 1fr); }
  .pal-exec-grid,
  .pal-exec-narrative { grid-template-columns: 1fr; }
  .pal-signal-grid { grid-template-columns: repeat(2, 1fr); }
  .pal-parking-grid { grid-template-columns: 1fr; }
  .pal-services-grid { grid-template-columns: 1fr; }
  .pal-school-summary-grid { grid-template-columns: 1fr; }
  .pal-comm-panels { grid-template-columns: 1fr; } /* 2×2 → single column */
  .pal-verdict-grid { grid-template-columns: 1fr; }
  /* v2.8.2 (24 Apr 2026) — Reduce hero height on mobile so a broken image
     doesn't occupy 60% of the phone screen; 45vh still feels hero-like
     (~416px on iPhone 13 Pro Max) without eating most of the initial viewport. */
  .pal-hero { min-height: 45vh; }
  .pal-hero-content { padding: var(--sp-7) var(--sp-6); }
  .pal-exec { padding: 0 var(--sp-4); }
  /* v2.9.8 (7 Jun 2026) — Breadcrumb used to be hidden on mobile
     (display:none), which left the neighbourhood nav showing only the logo,
     since these guides intentionally have no menu. Show it again so phone
     users keep their wayfinding trail. Let the nav wrap and tighten the
     horizontal padding so on narrow phones the breadcrumb drops onto its own
     line beneath the logo instead of forcing horizontal page scroll. Verified
     no overflow at 360/375/414px. */
  .pal-nav { flex-wrap: wrap; row-gap: 0.4rem; padding-left: 1.25rem; padding-right: 1.25rem; }
  .pal-breadcrumb { display: flex; flex-wrap: wrap; font-size: 0.72rem; }
  .pal-map-container { height: 320px; }
  .pal-affiliate-cta { flex-direction: column; text-align: center; }
  .pal-section-banner { height: 140px; }

  /* v2.8.2 (24 Apr 2026) — Budget tab bar horizontal scroll on mobile.
     Stratford has 5 tabs totalling ~675px wide; without overflow handling
     this forced horizontal page scroll on iPhone and broke the
     pal-reveal IntersectionObserver for sections further down (the
     "huge gap after Executive Summary, content only appears when you zoom
     out" bug reported 24 Apr). overflow-x: auto contains the scroll
     inside the tab bar itself; the rest of the page stays 100% of viewport
     wide. Hide the scrollbar for a cleaner look — touch users can swipe. */
  .pal-budget-tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .pal-budget-tab-bar::-webkit-scrollbar { display: none; }
  .pal-budget-tab { flex-shrink: 0; }

  /* v2.8.3 (24 Apr 2026) — Any <table> inside a section (crime data table,
     council table, etc.) becomes a horizontal-scroll block on mobile so its
     4+ columns don't force the section wider than the viewport. Paired with
     the main min-width:0 fix above — without that fix, a wide table still
     bloats `main`; with it, the table scrolls inside its own box. */
  .pal-guide.pal-guide .pal-section table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Community gallery on mobile (v3.6) —
     For the static row variant (≤3 images): turn it into a swipeable filmstrip
     with 70%-wide tiles so at least one is fully visible and the next peeks in.
     For the carousel variant (>3 images): swap the 1/3-basis tiles to ~80%
     so one tile fills most of the screen and the next peeks — then hide the
     arrow buttons since touch users will swipe. */
  .pal-comm-gallery--row:not(.pal-comm-gallery--carousel) {
    grid-auto-columns: 70%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: var(--sp-2);
  }
  .pal-comm-gallery--row:not(.pal-comm-gallery--carousel) .pal-comm-photo {
    scroll-snap-align: start;
  }
  .pal-comm-gallery--carousel .pal-comm-photo {
    flex: 0 0 80%;           /* one tile fills most of the viewport, next peeks */
  }
  .pal-comm-photo {
    height: 180px;           /* slightly taller than 160 — still snug on phones */
  }
  .pal-gal-arrow {
    display: none;           /* swipe UX on touch — arrows just get in the way */
  }
}

/* ── Tablet → phone (≤ 768px) ── */
@media (max-width: 768px) {
  .pal-school-columns { grid-template-columns: 1fr; }
  .pal-signal-grid { grid-template-columns: 1fr; }
}

/* ── Phone (≤ 480px) ── */
@media (max-width: 480px) {
  .pal-commute-grid { grid-template-columns: 1fr; }
  .pal-stat-grid { grid-template-columns: 1fr; }
}

/* ── Verdict responsive (≤ 768px) ── */
@media (max-width: 768px) {
  .pal-vb-neighbourhood { font-size: 1.8rem; }
  .pal-vb-gauge { width: 220px; height: 130px; }
  .pal-vb-number { font-size: 3rem; }
  .pal-vb-decimal { font-size: 2.2rem; }
  .pal-vb-editorial { padding: 1.2rem var(--sp-6) 1.4rem; }
  .pal-gauges-row { grid-template-columns: repeat(3, 1fr); }
  .pal-verdict-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   22. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   23. PRINT
   ============================================================ */
@media print {
  .pal-nav, .pal-guide-sidebar, .pal-affiliate-cta,
  .pal-ad-placeholder, .pal-valuation-cta, .pal-services,
  .pal-cta, .pal-guide.grain::before { display: none !important; }
  .pal-hero { min-height: auto; margin-top: 0; }
  .pal-guide-layout { display: block; }
  .pal-reveal { opacity: 1 !important; transform: none !important; }
  .pal-section { break-inside: avoid; }
}

/* ============================================================
   24. MOBILE FLOATING TOC
   ============================================================ */
#pal-mobile-toc {
  display: none;
}

@media (max-width: 900px) {
  #pal-mobile-toc {
    display: block;
    position: fixed;
    bottom: var(--sp-6);
    right: var(--sp-6);
    width: 200px;
    max-height: 280px;
    overflow-y: auto;
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--sp-4) var(--sp-5);
    border: var(--border-subtle);
    box-shadow: var(--shadow-xl);
    z-index: 50;
  }

  #pal-mobile-toc h3 {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: var(--sp-3);
  }

  #pal-mobile-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  #pal-mobile-toc li {
    margin-bottom: 0.3rem;
  }

  #pal-mobile-toc a {
    font-size: var(--text-xs);
    color: var(--text-caption);
    text-decoration: none;
    padding: 0.35rem var(--sp-2);
    display: block;
    border-radius: 6px;
    border-left: 2px solid transparent;
    transition: color 0.2s, background 0.2s;
  }

  #pal-mobile-toc a:hover,
  #pal-mobile-toc a.active {
    color: var(--pal-green);
    background: rgba(45, 95, 63, 0.04);
    border-left-color: var(--pal-green);
  }

  #pal-mobile-toc-toggle {
    position: fixed;
    bottom: var(--sp-6);
    right: var(--sp-6);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--pal-green);
    color: white;
    border: none;
    font-size: var(--heading-lg);
    cursor: pointer;
    z-index: 51;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s var(--ease-bounce);
  }

  #pal-mobile-toc-toggle:hover {
    transform: scale(1.08);
  }

  #pal-mobile-toc-toggle:focus-visible {
    outline: 2px solid var(--pal-gold);
    outline-offset: 2px;
  }

  #pal-mobile-toc.is-hidden {
    display: none;
  }
}

@media (min-width: 901px) {
  #pal-mobile-toc,
  #pal-mobile-toc-toggle {
    display: none !important;
  }
}

/* ============================================================
   25. EMAIL GATE (progressive content lock)
   ============================================================ */

/* Force visibility — overrides the pal-reveal scroll animation system */
.pal-email-gate.pal-reveal {
  opacity: 1 !important;
  transform: none !important;
}

.pal-email-gate {
  position: relative;
  margin: var(--sp-9) 0 var(--sp-8);
  padding: var(--sp-8) var(--sp-7) var(--sp-7);
  background: rgba(45, 95, 63, 0.05);
  border: 1.5px solid rgba(45, 95, 63, 0.25);
  border-radius: 16px;
  text-align: center;
  overflow: hidden;
}

.pal-email-gate-inner {
  position: relative;
  z-index: 2;
  max-width: 520px;
  margin: 0 auto;
}

.pal-email-gate-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--pal-green-light);
  margin-bottom: var(--sp-4);
  font-size: var(--data-md);
}

.pal-email-gate h3 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  color: var(--text-heading);
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
}

.pal-email-gate p {
  color: var(--text-body);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
  margin: 0 0 var(--sp-5);
}

.pal-gate-preview {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0 auto var(--sp-6);
  padding: 0;
  list-style: none;
  max-width: 340px;
  text-align: left;
}

.pal-gate-preview li {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-body);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.4;
}

.pal-gate-preview li::before {
  content: '•';
  flex-shrink: 0;
  color: var(--pal-green);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
}

.pal-gate-form {
  display: flex;
  gap: 0;
  max-width: 420px;
  margin: 0 auto var(--sp-3);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(26, 35, 50, 0.12);
  transition: border-color 0.2s;
}

.pal-gate-form:focus-within {
  border-color: var(--pal-green);
  box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.08);
}

.pal-gate-form input[type="email"] {
  flex: 1;
  padding: var(--sp-3) var(--sp-4);
  border: none;
  background: white;
  font-size: var(--text-base);
  color: var(--text-heading);
  outline: none;
  min-width: 0;
}

.pal-gate-form input[type="email"]::placeholder {
  color: var(--text-faint);
}

.pal-gate-form button {
  padding: var(--sp-3) var(--sp-6);
  background: var(--pal-green);
  color: white;
  border: none;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.pal-gate-form button:hover {
  background: #245232;
}

.pal-gate-form button:focus-visible {
  outline: 2px solid var(--pal-gold);
  outline-offset: -2px;
}

.pal-gate-small {
  font-size: var(--text-xxs);
  color: var(--text-faint);
  margin: 0;
}

.pal-gate-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: var(--sp-3);
  font-size: var(--text-xs);
  color: var(--text-caption);
}

.pal-gate-proof-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pal-green);
  opacity: 0.6;
}

/* ── Soft-gate classes (v4.0 — 2026-04-24) ─────────────────────────────
   Gated content is ALWAYS rendered in the HTML (so Google indexes it).
   Visibility is driven by the .pal-unlocked class on <html>, applied by
   pal_unlock_inline_script() in functions.php when the pal_unlocked cookie
   is present. Google accepts this as a legitimate registration wall via
   the isAccessibleForFree + hasPart.cssSelector schema emitted by
   rank-math.php — the HTML is identical for every visitor, only CSS differs.

   .pal-section--free  → always fully visible (schema: isAccessibleForFree=true)
   .pal-section--gated → CSS-hidden when locked, fully visible when unlocked
                         (schema: isAccessibleForFree=false)
   ──────────────────────────────────────────────────────────────────── */

.pal-section--free  { /* schema marker — always rendered */ }

/* Default (locked) state — fade-and-mask gated content, pin a compact
   "subscribe to unlock" CTA over the bottom fade. Assumes the existing
   .pal-email-gate widget sits between Crime and Council as the primary
   conversion surface; the overlay on each gated block is a visual cue
   that points the reader to that form. */
.pal-section--gated {
  position: relative;
  overflow: hidden;
}

html:not(.pal-unlocked) .pal-section--gated {
  max-height: 220px;                /* show a strip of the gated body */
  -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
  position: relative;
  pointer-events: none;              /* prevent click-through into hidden text */
  user-select: none;
}

html:not(.pal-unlocked) .pal-section--gated::after {
  content: 'Unlock the full guide below — it\0027 s free, just your email.';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.85rem 1rem;
  background: linear-gradient(
    to top,
    rgba(248, 246, 241, 0.98) 0%,
    rgba(248, 246, 241, 0.95) 60%,
    rgba(248, 246, 241, 0)    100%
  );
  color: var(--pal-navy, #1a2332);
  font-family: var(--font-display, 'Inter', sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.01em;
  pointer-events: auto;
  user-select: text;
}

/* v2.9.5 (12 May 2026) — Real clickable unlock CTA.
   The original ::after pseudo-element above is decorative text only —
   pseudo-elements cannot be made into <a> links, so a user reading
   "Unlock the full guide below" had no way to click through to the
   email form. Below: a real-element CTA injected by JS (see
   pal_unlock_inline_script in functions.php) that overlays the bottom
   of each gated section and links to #palEmailGate. The CSS ::after
   above stays as a JS-less fallback; when JS injects this real CTA,
   the <html> gets a `pal-cta-injected` class which hides the ::after
   text to avoid duplication. */
html:not(.pal-unlocked) .pal-section--gated .pal-section--gated__cta {
  position: absolute;
  left: 50%;
  bottom: 0.75rem;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--pal-green);
  color: white;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 22px rgba(26,35,50,0.20);
  pointer-events: auto;
  cursor: pointer;
  z-index: 3;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s ease-out, box-shadow 0.2s;
}
html:not(.pal-unlocked) .pal-section--gated .pal-section--gated__cta:hover {
  background: #244c30;
  transform: translateX(-50%) translateY(-1px);
  box-shadow: 0 8px 26px rgba(26,35,50,0.26);
}
html:not(.pal-unlocked) .pal-section--gated .pal-section--gated__cta:focus-visible {
  outline: 2px solid var(--pal-gold);
  outline-offset: 2px;
}

/* When JS has injected the real CTA, suppress the decorative ::after
   text so the button stands alone (no duplicate "unlock" message). */
html.pal-cta-injected:not(.pal-unlocked) .pal-section--gated::after {
  display: none;
}

/* Unlocked state — all gated content fully visible, no mask, no overlay */
html.pal-unlocked .pal-section--gated {
  max-height: none;
  -webkit-mask-image: none;
          mask-image: none;
  pointer-events: auto;
  user-select: auto;
}

html.pal-unlocked .pal-section--gated::after,
html.pal-unlocked .pal-section--gated__cta {
  display: none;
}

/* The main email gate widget is always visible to locked visitors and hidden
   once unlocked. This was previously handled by PHP (widget not rendered when
   unlocked); kept as a CSS safety net in case server-render timing differs. */
html.pal-unlocked .pal-email-gate { display: none; }

/* Respect reduced-motion preference (mask fade already is motion-free, but
   any future animated overlay should honour this). */
@media (prefers-reduced-motion: reduce) {
  html:not(.pal-unlocked) .pal-section--gated {
    transition: none;
  }
}


/* ============================================================
   26. PAL IN-DEPTH — Premium Content Treatments (v3.2)
   ============================================================
   Two visual treatments for gated (unlocked) content:
   • C2-Blue  — frosted glass + PAL blue border frame (workhorse)
   • E2-Dark  — dark frosted glass panel (verdict only)
   Both carry the "PAL IN-DEPTH" tag and logo watermark.
   ============================================================ */

/* ── C2-Blue: Frosted Glass + Blue Border Frame ── */
.pal-indepth {
  background: linear-gradient(145deg, #4A7C8C 0%, #3a6575 60%, #4A7C8C 100%);
  border-radius: var(--radius-lg, 16px);
  padding: 2px;
  box-shadow:
    0 4px 24px rgba(74, 124, 140, 0.15),
    0 1px 3px rgba(74, 124, 140, 0.08);
  margin-top: var(--sp-5, 1.5rem);
}

.pal-indepth-inner {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-radius: calc(var(--radius-lg, 16px) - 2px);
  padding: var(--sp-7, 2rem);
  position: relative;
  overflow: hidden;
}

/* Logo watermark */
.pal-indepth-inner::after {
  content: '';
  position: absolute;
  top: -10px;
  right: -10px;
  width: 120px;
  height: 120px;
  background: url('/wp-content/uploads/2026/03/PAL-Logo-graphics.png') no-repeat center / contain;
  opacity: 0.12;
  transform: rotate(12deg);
  pointer-events: none;
  z-index: 0;
}

.pal-indepth-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  background: rgba(74, 124, 140, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  border-radius: 6px;
  font-size: var(--text-xxs, 0.68rem);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: var(--sp-4, 1rem);
  position: relative;
  z-index: 1;
}

.pal-indepth-inner > h4,
.pal-indepth-inner > p,
.pal-indepth-inner > div:not(.pal-indepth-tag) {
  position: relative;
  z-index: 1;
}

/* ── C2-Blue: tables inside frosted glass cards ──
   Old selectors: .pal-guide.pal-guide .pal-section table:not():not() th = (0,5,2)
   New selectors: .pal-guide.pal-guide .pal-section .pal-indepth .pal-indepth-inner table th = (0,5,2)
   Same specificity, later source order wins. */
.pal-guide.pal-guide .pal-section .pal-indepth .pal-indepth-inner table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-4, 1rem) 0;
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
  border: 2px solid #ffffff;
  background: transparent;
  position: relative;
  z-index: 1;
}

.pal-guide.pal-guide .pal-section .pal-indepth .pal-indepth-inner table th {
  font-weight: 600;
  text-align: left;
  padding: 0.65rem var(--sp-3, 0.75rem);
  background: rgba(74, 124, 140, 0.28);
  color: var(--text-heading);
  border-bottom: 2px solid rgba(74, 124, 140, 0.35);
  font-size: var(--text-sm, 0.85rem);
}

.pal-guide.pal-guide .pal-section .pal-indepth .pal-indepth-inner table td {
  padding: 0.6rem var(--sp-3, 0.75rem);
  border-bottom: 1px solid rgba(74, 124, 140, 0.15);
  font-size: var(--text-sm, 0.85rem);
}

.pal-guide.pal-guide .pal-section .pal-indepth .pal-indepth-inner table tr:nth-child(even) {
  background: rgba(74, 124, 140, 0.12);
}

.pal-guide.pal-guide .pal-section .pal-indepth .pal-indepth-inner table tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.5);
}

.pal-guide.pal-guide .pal-section .pal-indepth .pal-indepth-inner table tr:last-child td {
  border-bottom: none;
}


/* ── E2-Verdict: Navy Frosted Glass Panel (verdict) ──
   Lighter than the original dark panel — uses a navy-tinted frosted glass
   so existing text/link colours from the parent theme remain readable.
   Visually distinct from C2-Blue via the green-gold gradient bar and
   deeper tint. */
.pal-indepth-dark {
  background: linear-gradient(145deg, rgba(26, 35, 50, 0.12) 0%, rgba(45, 95, 63, 0.06) 100%);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-radius: var(--radius-lg, 16px);
  padding: var(--sp-7, 2rem);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 4px 24px rgba(26, 35, 50, 0.1),
    0 1px 3px rgba(0, 0, 0, 0.06);
  border: 2px solid var(--pal-navy, #1a2332);
  margin-top: var(--sp-5, 1.5rem);
}

/* Green-gold gradient bar at top */
.pal-indepth-dark::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right, var(--pal-green), var(--pal-gold), var(--pal-green));
  z-index: 2;
}

/* Logo watermark */
.pal-indepth-dark::after {
  content: '';
  position: absolute;
  top: -10px;
  right: -10px;
  width: 120px;
  height: 120px;
  background: url('/wp-content/uploads/2026/03/PAL-Logo-graphics.png') no-repeat center / contain;
  opacity: 0.12;
  transform: rotate(12deg);
  pointer-events: none;
  z-index: 0;
}

.pal-indepth-dark .pal-indepth-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--sp-4, 1rem);
  position: relative;
  z-index: 1;
}

.pal-indepth-dark .pal-indepth-tag {
  background: var(--pal-navy, #1a2332);
  color: #ffffff;
}

.pal-indepth-dark .pal-indepth-eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(26, 35, 50, 0.2), transparent);
}

/* ── E2-Verdict: z-index stacking ── */
.pal-indepth-dark h3,
.pal-indepth-dark h4,
.pal-indepth-dark .pal-verdict-grid,
.pal-indepth-dark .pal-verdict-narrative,
.pal-indepth-dark .pal-verdict-rec,
.pal-indepth-dark .pal-verdict-outlook,
.pal-indepth-dark .pal-verdict-recommend {
  position: relative;
  z-index: 1;
}

/* ── E2-Verdict: headings use navy ── */
.pal-indepth-dark h3,
.pal-indepth-dark h4,
.pal-indepth-dark .pal-verdict-col h3,
.pal-indepth-dark .pal-verdict-narrative h4 {
  color: var(--pal-navy, #1a2332);
}

/* ── E2-Verdict: rec gold accent preserved ── */
.pal-indepth-dark .pal-verdict-rec {
  border-top-color: var(--pal-gold);
}

.pal-indepth-dark .pal-verdict-rec h4 {
  color: var(--pal-gold);
}

/* ── E2-Verdict: dividers ── */
.pal-indepth-dark .pal-verdict-narrative {
  border-top-color: rgba(26, 35, 50, 0.1);
}

/* ── E2-Verdict: check/cross marks ── */
.pal-indepth-dark-check {
  color: var(--pal-green, #2d5f3f);
}

.pal-indepth-dark-cross {
  color: var(--pal-red, #c44536);
}

/* ── E2-Verdict: contextual link paragraph ── */
.pal-indepth-dark .pal-contextual-link,
.pal-indepth-dark .pal-contextual-link[style] {
  background: rgba(26, 35, 50, 0.05) !important;
  border-left: 3px solid var(--pal-navy, #1a2332) !important;
  color: var(--text-body) !important;
  font-size: 0.9rem !important;
}

/* ── Mobile adjustments ── */
@media (max-width: 480px) {
  .pal-indepth { margin-top: var(--sp-4, 1rem); }
  .pal-indepth-inner { padding: var(--sp-5, 1.25rem); }
  .pal-indepth-inner::after,
  .pal-indepth-dark::after { width: 80px; height: 80px; top: -5px; right: -5px; }
  .pal-indepth-dark { padding: var(--sp-5, 1.25rem); }
}

/* ── Unlock toast (v3.1) ──
   Slim notification shown once at top of guide after email unlock.
   Auto-dismisses after 8s or via close button. */
.pal-unlock-toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: 0 0 var(--sp-5);
  padding: var(--sp-3) var(--sp-4);
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
  border: 1px solid rgba(45, 95, 63, 0.2);
  border-left: 4px solid var(--pal-green, #2d5f3f);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-primary);
}

.pal-unlock-toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.pal-unlock-toast strong {
  color: var(--pal-green, #2d5f3f);
}

.pal-unlock-toast-close {
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.2rem;
  line-height: 1;
}

.pal-unlock-toast-close:hover {
  color: var(--text-primary);
}

@media (max-width: 480px) {
  .pal-email-gate {
    padding: var(--sp-7) var(--sp-5) var(--sp-6);
    margin: var(--sp-7) 0 var(--sp-6);
  }

  .pal-gate-form {
    flex-direction: column;
    border-radius: 10px;
  }

  .pal-gate-form input[type="email"] {
    border-bottom: 1px solid rgba(26, 35, 50, 0.08);
    border-radius: 10px 10px 0 0;
  }

  .pal-gate-form button {
    border-radius: 0 0 10px 10px;
    padding: var(--sp-3) var(--sp-6);
  }

  .pal-gate-preview {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
  }
}

/* ============================================================
   LIGHTBOX OVERLAY — v3.5 (Community gallery click-to-enlarge)
   Minimal vanilla-JS lightbox: fullscreen backdrop, centred figure,
   keyboard + arrow + ESC navigation. Hidden via [hidden] attribute.
   ============================================================ */
.pal-lightbox[hidden] { display: none; }
.pal-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 22, 33, 0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: palLbFade 0.18s ease-out;
}
@keyframes palLbFade { from { opacity: 0; } to { opacity: 1; } }

.pal-lightbox-figure {
  position: relative;
  margin: 0;
  max-width: min(1200px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pal-lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  background: #0f1621;
}
.pal-lightbox-caption {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  line-height: 1.4;
  margin-top: 0.9rem;
  text-align: center;
  max-width: 70ch;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
/* Credit line (photo attribution) renders smaller and dimmer under caption. */
.pal-lightbox-credit {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
}
.pal-lightbox-credit[hidden] { display: none; }

/* Control buttons (close, prev, next) */
.pal-lightbox-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.pal-lightbox-btn:hover,
.pal-lightbox-btn:focus-visible {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.05);
  outline: none;
}
.pal-lightbox-close { top: 1.5rem; right: 1.5rem; }
.pal-lightbox-prev  { left:  1.5rem; top: 50%; transform: translateY(-50%); }
.pal-lightbox-next  { right: 1.5rem; top: 50%; transform: translateY(-50%); }
.pal-lightbox-prev:hover,
.pal-lightbox-prev:focus-visible { transform: translateY(-50%) scale(1.05); }
.pal-lightbox-next:hover,
.pal-lightbox-next:focus-visible { transform: translateY(-50%) scale(1.05); }

/* Mobile lightbox tweaks */
@media (max-width: 1024px) {
  .pal-lightbox { padding: 1rem; }
  .pal-lightbox-btn { width: 40px; height: 40px; font-size: 1.2rem; }
  .pal-lightbox-close { top: 1rem; right: 1rem; }
  .pal-lightbox-prev  { left:  0.6rem; }
  .pal-lightbox-next  { right: 0.6rem; }
  .pal-lightbox-img   { max-height: 75vh; }
}

/* ===================================================================
   PAL Neighbourhood Locator widget  (added Jun 2026)
   Overview boroughs map + zoom-to-lightbox neighbourhood detail.
   Markup: template-parts/locator-map.php · JS: assets/pal-locator.js
   =================================================================== */
.pal-loc{max-width:340px;margin:0 0 28px}
.pal-loc-maptop{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.pal-loc-cap{font-size:.64rem;letter-spacing:.1em;text-transform:uppercase;color:#1a2332;font-weight:700}
.pal-loc-zoom{display:inline-flex;align-items:center;gap:6px;border:1px solid rgba(26,35,50,.10);background:#fffdf8;color:#2c3e50;font-size:.74rem;font-weight:600;padding:6px 11px;border-radius:20px;cursor:pointer;font-family:inherit;transition:all .2s cubic-bezier(.34,1.56,.64,1)}
.pal-loc-zoom:hover{border-color:#4a7c8c;color:#4a7c8c}
.pal-loc-frame{position:relative;background:#fffdf8;border:1px solid rgba(26,35,50,.10);border-radius:14px;overflow:hidden;cursor:zoom-in}
.pal-loc-frame svg{display:block;width:100%;height:auto}
.pal-loc-hint{position:absolute;right:10px;bottom:10px;display:inline-flex;align-items:center;gap:5px;background:rgba(26,35,50,.82);color:#fff;font-size:.66rem;font-weight:600;padding:5px 9px;border-radius:20px;opacity:0;transform:translateY(4px);transition:.2s}
.pal-loc-frame:hover .pal-loc-hint{opacity:1;transform:translateY(0)}
.pal-loc-scale{font-size:.66rem;color:#2c3e50;text-align:center;margin:8px 0 0;font-style:italic;font-weight:500}
.pal-loc-legend{display:flex;gap:14px;justify-content:center;margin-top:8px;font-size:.62rem;color:#2c3e50;font-weight:600}
.pal-loc-legend i{display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:5px;vertical-align:middle}
/* Locator (left) + key stats 2x2 (right), side by side */
.pal-loc-stats-row{display:flex;gap:var(--sp-6);align-items:stretch;margin-bottom:var(--sp-7)}
.pal-loc-stats-row .pal-loc{margin:0;flex:0 0 340px;max-width:340px}
.pal-loc-stats-row .pal-stat-grid{flex:1 1 0;grid-template-columns:repeat(2,1fr);margin-bottom:0}
@media (max-width:860px){.pal-loc-stats-row{flex-direction:column}.pal-loc-stats-row .pal-loc{flex:none}}
body.pal-loc-locked{overflow:hidden}
.pal-loc-lb{position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(20,27,40,.55);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);opacity:0;pointer-events:none;transition:opacity .25s}
.pal-loc-lb.open{opacity:1;pointer-events:auto}
.pal-loc-lb-card{background:#fffdf8;border-radius:20px;box-shadow:0 8px 24px rgba(26,35,50,.12),0 28px 70px rgba(26,35,50,.22);max-width:760px;width:100%;max-height:92vh;overflow:auto;transform:scale(.94) translateY(8px);opacity:0;transition:transform .3s cubic-bezier(.34,1.56,.64,1),opacity .25s}
.pal-loc-lb.open .pal-loc-lb-card{transform:scale(1) translateY(0);opacity:1}
.pal-loc-lb-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:22px 24px 0}
.pal-loc-lb-head h3{font-family:Spectral,Georgia,serif;font-weight:600;font-size:1.4rem;color:#1a2332;margin:0}
.pal-loc-lb-head p{margin:4px 0 0;font-size:.84rem;color:#6c757d}
.pal-loc-lb-close{flex:none;width:34px;height:34px;border-radius:50%;border:1px solid rgba(26,35,50,.10);background:#fffdf8;color:#1a2332;font-size:1.1rem;cursor:pointer}
.pal-loc-lb-close:hover{background:#1a2332;color:#fff}
.pal-loc-lb-map{padding:16px 24px 4px}
.pal-loc-lb-map svg{display:block;width:100%;height:auto;border:1px solid rgba(26,35,50,.10);border-radius:14px;background:#fffdf8}
.pal-loc-lb-legend{display:flex;gap:18px;flex-wrap:wrap;padding:6px 24px 0;font-size:.78rem;color:#6c757d}
.pal-loc-lb-legend span{display:inline-flex;align-items:center;gap:7px}
.pal-loc-lb-legend i{width:12px;height:12px;border-radius:50%;display:inline-block}
.pal-loc-lb-pills{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;padding:16px 24px 24px}
.pal-loc-pill{background:#fffdf8;border:1px solid rgba(26,35,50,.10);border-radius:14px;padding:11px 8px;text-align:center}
.pal-loc-pk{font-size:.58rem;letter-spacing:.07em;text-transform:uppercase;color:#95a5a6;font-weight:600}
.pal-loc-pv{font-family:'JetBrains Mono',monospace;font-weight:600;font-size:1.05rem;color:#1a2332;margin-top:3px;display:flex;align-items:center;justify-content:center;gap:5px}
.pal-loc-pv>span{font-size:.7rem;color:#6c757d}
.pal-loc-pdot{width:9px!important;height:9px!important;border-radius:50%;display:inline-block;background:#2d5f3f}
@media(max-width:600px){.pal-loc{max-width:none}.pal-loc-lb-pills{grid-template-columns:1fr 1fr 1fr}}
