/*
Theme Name: Royal Engineer Advisory Theme
Description: A clean, accessible corporate theme designed for independent Financial Planners. Includes local self-hosted fonts for complete UK GDPR compliance, smart-edge dropdown support, interactive block linking, responsive touch navigation, an automated single-card carousel, adviser trust bar, sidebar CTA integration, and professional commentary/news post templates with pre-populated contextual inquiries.
Version: 5.5.15
Requires at least: 6.3
Requires PHP: 7.4
License: GPL-2.0-or-later
Author: James King
Text Domain: re-advisor
Changelog: v5.5.15 - Rendered pages containing the [re_booking_calendar] shortcode in the full-width standalone layout without the adviser sidebar, matching the Contact page.
v5.5.14 - Added live 6px/8px corner radius tokens (--re-radius-control and --re-radius-card), unified primary CTA shadow/hover/focus and reduced-motion rules, added adaptive secondary hero outline button styles, standardised adviser sidebar card top border to 4px, updated Trust Bar icons to 6px architectural squares, and tightened footer disclosure reading width to 720px.
v5.5.13 - Wrapped mobile submenu close button in a valid list item, added SEO/Open Graph tags on the Commentary index with word-boundary description trimming, fixed homepage heading hierarchy, and removed duplicate sidebar CSS padding.
v5.5.12 - Added matching gold underline to active top-level header navigation links on desktop, crimson active state in dropdown sub-menus, and crimson left accent in the mobile drawer to match the Cashflow Planner header.
v5.5.11 - Restricted re_resolve_link() to published pages only, fixed homepage carousel autoplay start/stop on viewport resize, and restored keyboard/screen-reader accessibility for visibly rendered cloned carousel cards.
v5.5.10 - Skipped theme font preloads on the Cashflow Planner route to prevent duplicate font downloads alongside the planner bundle, and aligned fallback theme version to 5.5.10.
v5.5.9 - Excluded password-protected posts from the Commentary header dropdown, prevented synthetic menu item ID collisions, aligned fallback Privacy Policy links and standalone detection with WordPress Privacy settings, decoded sidebar fallback site name entities, and fixed carousel hover/focus autoplay pausing.
v5.5.8 - Fixed Escape-key submenu dismissal on desktop, improved hybrid mouse/touch navigation and alignment, restored visible keyboard focus outlines across navigation and carousel controls, fixed Commentary dropdown cache invalidation on permanent post deletion, and prevented double-escaped HTML entities in SEO metadata and fallback feature card titles.
v5.5.7 - Enabled tap-to-open navigation dropdowns on wide touchscreens (landscape tablets), fixed backwards homepage carousel clone ordering, hid the carousel Play/Pause button when Reduced Motion is active, added dedicated SEO and social metadata for the Cashflow Planner route, and aligned theme fallback version.
v5.4.8 - Resolved missing closing braces in CSS selectors and media queries, corrected PHP tag and conditional closures across theme templates, and enhanced carousel WCAG 2.1 keyboard focus handling.
*/

/* ==========================================================================
   1. SELF-HOSTED LOCAL FONTS (Inter & Merriweather) FOR UK GDPR COMPLIANCE
   Loading fonts locally ensures no visitor IP addresses or tracking cookies
   are transmitted to third-party CDNs (such as Google Fonts).
   ========================================================================== */

/* Inter Sans-Serif: Primary interface & body typography */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/inter-v20-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/inter-v20-latin-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/inter-v20-latin-600.woff2') format('woff2');
}

/* Merriweather Serif: Editorial headlines & financial commentary */
@font-face {
  font-family: 'Merriweather';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('assets/fonts/merriweather-v33-latin-300.woff2') format('woff2');
}

@font-face {
  font-family: 'Merriweather';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/merriweather-v33-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Merriweather';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/merriweather-v33-latin-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Merriweather';
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url('assets/fonts/merriweather-v33-latin-300italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Merriweather';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/merriweather-v33-latin-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Merriweather';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/merriweather-v33-latin-700italic.woff2') format('woff2');
}

/* ==========================================================================
   2. BRAND COLOUR VARIABLES & CORE TOKENS
   Standardized palette inspired by traditional military engineering colors:
   Deep Navy, Regimental Crimson, and Architectural Warm Linen.
   ========================================================================== */
:root {
  --re-blue: #002B49;            /* Primary Deep Navy */
  --re-blue-dark: #001E33;       /* Dark Navy Background Shade */
  --re-red: #862633;             /* Regimental Crimson Accent */
  --re-red-hover: #6B1E28;       /* Crimson Hover State */
  --re-gold: #C5A059;            /* Gold Credential Highlight */
  --re-white: #FFFFFF;           /* Neutral Surface White */
  --re-light-grey: #F4F1EA;      /* Warm Architectural Linen */
  --re-dark-text: #1E293B;       /* High-Contrast Body Text */
  --re-muted-text: #526074;      /* Supporting Subtext */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Merriweather', Georgia, serif;
  --re-radius-control: 6px;      /* Interactive controls, inputs, alerts, icon badges */
  --re-radius-card: 8px;         /* Cards, sidebars, modals, callout boxes, headshots */
}

/* Base body reset ensuring smooth font rendering */
body {
  font-family: var(--font-body);
  color: var(--re-dark-text);
  background-color: var(--re-white);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* Inherit clean typography across structural elements */
p, a, li, ul, ol, input, select, textarea, button, div, span, .entry-content, .wp-block-paragraph, .wp-block-group, .wp-block-column {
  font-family: var(--font-body);
}

/* Apply editorial serif font to all headings */
h1, h2, h3, h4, h5, h6, .site-title a, .wp-block-heading {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

/* Responsive image safeguard */
img {
  max-width: 100%;
  height: auto;
}

/* WordPress media alignment utility classes */
.aligncenter {
  display: block;
  margin: 1.5rem auto;
  border-radius: var(--re-radius-card);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.alignleft {
  float: left;
  margin: 0.5rem 1.5rem 1.5rem 0;
  border-radius: var(--re-radius-card);
}

.alignright {
  float: right;
  margin: 0.5rem 0 1.5rem 1.5rem;
  border-radius: var(--re-radius-card);
}

/* Accessible keyboard skip-to-content link */
.skip-link {
  position: absolute;
  top: -1000px;
  left: -1000px;
  background: var(--re-red);
  color: var(--re-white);
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  z-index: 100000;
  text-decoration: none;
  border-radius: 0 0 var(--re-radius-control) 0;
}

.skip-link:focus {
  top: 0;
  left: 0;
  outline: 3px solid #000;
}

/* ==========================================================================
   3. SITE HEADER & PRIMARY NAVIGATION
   Sticky-ready header bar with smart dropdown positioning and mobile drawer.
   ========================================================================== */
.site-header {
  background-color: var(--re-blue);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 4px solid var(--re-red);
  flex-wrap: nowrap;
  position: relative;
  overflow: visible;
}

.site-title {
  flex: 0 1 auto;
  min-width: 0;
  margin-right: 1.5rem;
}

.site-title a {
  color: var(--re-white);
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  word-wrap: break-word;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 999;
  flex: 0 0 auto;
}

.hamburger-icon {
  display: block;
  width: 26px;
  height: 3px;
  background-color: var(--re-white);
  position: relative;
  transition: background-color 0.2s ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  position: absolute;
  width: 26px;
  height: 3px;
  background-color: var(--re-white);
  left: 0;
  transition: transform 0.2s ease;
}

.hamburger-icon::before { top: -8px; }
.hamburger-icon::after { bottom: -8px; }

.mobile-menu-toggle.is-active .hamburger-icon { background-color: transparent; }
.mobile-menu-toggle.is-active .hamburger-icon::before { transform: translateY(8px) rotate(45deg); }
.mobile-menu-toggle.is-active .hamburger-icon::after { transform: translateY(-8px) rotate(-45deg); }

.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1.25rem 2rem;
}

.main-navigation a {
  color: var(--re-white);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.main-navigation a:hover,
.main-navigation a:focus {
  opacity: 0.8;
  text-decoration: underline;
}

.main-navigation a:focus-visible,
.mobile-menu-toggle:focus-visible,
.re-close-submenu:focus-visible {
  outline: 2px solid var(--re-gold);
  outline-offset: 2px;
}

.main-navigation li {
  position: relative;
}

/* Primary dropdown container */
.main-navigation .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--re-blue);
  min-width: 240px;
  max-width: min(320px, 90vw);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.3);
  border-top: 3px solid var(--re-red);
  z-index: 9999;
  padding: 0.5rem 0;
  border-radius: 0 0 var(--re-radius-control) var(--re-radius-control);
  flex-direction: column;
  gap: 0;
}

.main-navigation > div > ul > li:last-child > .sub-menu,
.main-navigation > ul > li:last-child > .sub-menu,
.main-navigation .sub-menu.align-right {
  left: auto;
  right: 0;
}

.main-navigation .sub-menu .sub-menu {
  display: flex;
  position: static;
  box-shadow: none;
  border-top: none;
  border-left: 2px solid rgba(255, 255, 255, 0.25);
  margin: 0 0 0.25rem 1.25rem;
  padding: 0;
  min-width: 0;
  max-height: none;
  overflow: visible;
  background: transparent;
}

/* Wide-viewport dropdown layout, keyboard focus, and tablet touch reveal */
@media (min-width: 901px) {
  .main-navigation li:focus-within:not(.re-submenu-dismissed) > .sub-menu,
  .main-navigation .menu-item-has-children.touch-active > .sub-menu {
    display: flex;
    animation: fadeInMenu 0.2s ease-in-out;
  }

  .main-navigation > ul > li > a,
  .main-navigation > div > ul > li > a {
    position: relative;
    display: inline-block;
    padding: 0.25rem 0;
  }

  .main-navigation > ul > li.current-menu-item > a,
  .main-navigation > ul > li.current-menu-parent > a,
  .main-navigation > ul > li.current-menu-ancestor > a,
  .main-navigation > ul > li.current_page_item > a,
  .main-navigation > ul > li.current_page_parent > a,
  .main-navigation > ul > li.current_page_ancestor > a,
  .main-navigation > div > ul > li.current-menu-item > a,
  .main-navigation > div > ul > li.current-menu-parent > a,
  .main-navigation > div > ul > li.current-menu-ancestor > a,
  .main-navigation > div > ul > li.current_page_item > a,
  .main-navigation > div > ul > li.current_page_parent > a,
  .main-navigation > div > ul > li.current_page_ancestor > a {
    font-weight: 600;
  }

  .main-navigation > ul > li.current-menu-item > a:hover,
  .main-navigation > ul > li.current-menu-parent > a:hover,
  .main-navigation > ul > li.current-menu-ancestor > a:hover,
  .main-navigation > ul > li.current_page_item > a:hover,
  .main-navigation > ul > li.current_page_parent > a:hover,
  .main-navigation > ul > li.current_page_ancestor > a:hover,
  .main-navigation > div > ul > li.current-menu-item > a:hover,
  .main-navigation > div > ul > li.current-menu-parent > a:hover,
  .main-navigation > div > ul > li.current-menu-ancestor > a:hover,
  .main-navigation > div > ul > li.current_page_item > a:hover,
  .main-navigation > div > ul > li.current_page_parent > a:hover,
  .main-navigation > div > ul > li.current_page_ancestor > a:hover {
    text-decoration: none;
  }

  .main-navigation > ul > li.current-menu-item > a::after,
  .main-navigation > ul > li.current-menu-parent > a::after,
  .main-navigation > ul > li.current-menu-ancestor > a::after,
  .main-navigation > ul > li.current_page_item > a::after,
  .main-navigation > ul > li.current_page_parent > a::after,
  .main-navigation > ul > li.current_page_ancestor > a::after,
  .main-navigation > div > ul > li.current-menu-item > a::after,
  .main-navigation > div > ul > li.current-menu-parent > a::after,
  .main-navigation > div > ul > li.current-menu-ancestor > a::after,
  .main-navigation > div > ul > li.current_page_item > a::after,
  .main-navigation > div > ul > li.current_page_parent > a::after,
  .main-navigation > div > ul > li.current_page_ancestor > a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 3px;
    background-color: var(--re-gold);
  }

  .main-navigation .sub-menu li {
    width: 100%;
  }

  .main-navigation .sub-menu a {
    padding: 0.75rem 1.25rem;
    display: block;
    font-size: 0.95rem;
    color: var(--re-white);
    transition: background-color 0.2s ease;
    white-space: normal;
    line-height: 1.4;
  }

  .main-navigation .sub-menu a:hover,
  .main-navigation .sub-menu a:focus {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
  }

  .main-navigation .sub-menu li.current-menu-item > a,
  .main-navigation .sub-menu li.current_page_item > a {
    background-color: var(--re-red);
    font-weight: 600;
  }
}

/* Desktop pointer hover reveal */
@media (min-width: 901px) and (hover: hover) {
  .main-navigation li:hover:not(.re-submenu-dismissed) > .sub-menu {
    display: flex;
    animation: fadeInMenu 0.2s ease-in-out;
  }
}

.re-close-submenu {
  display: none;
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1.25rem;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.re-close-submenu:hover {
  background: rgba(255, 255, 255, 0.25);
}

.main-navigation .menu-item-has-children.touch-active > .sub-menu .re-close-submenu {
  display: block;
}

@keyframes fadeInMenu {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   4. INNER PAGE LAYOUT, BRANDED HERO BANNER & TYPOGRAPHY
   ========================================================================== */
.re-inner-hero {
  background: linear-gradient(135deg, var(--re-blue) 0%, var(--re-blue-dark) 100%);
  padding: 3rem 2rem;
  text-align: center;
  border-bottom: 4px solid var(--re-red);
  margin-bottom: 3rem;
}

.re-inner-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.re-inner-hero-title {
  color: var(--re-white);
  font-size: 2.5rem;
  margin: 0;
  font-family: var(--font-heading);
}

.site-main-inner {
  max-width: 900px;
  margin: 0 auto 3.5rem;
  padding: 0 2rem;
  min-height: 60vh;
}

.site-main-inner-center {
  max-width: 900px;
  margin: 0 auto 3.5rem;
  padding: 0 2rem;
  min-height: 60vh;
  text-align: center;
}

.site-main-with-sidebar {
  max-width: 1200px;
  margin: 0 auto 3.5rem;
  padding: 0 2rem;
  min-height: 60vh;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 3.5rem;
  align-items: start;
  box-sizing: border-box;
}

.page-title {
  color: var(--re-blue);
  border-bottom: 2px solid var(--re-red);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 2.25rem;
}

.re-post-meta {
  color: var(--re-muted-text);
  font-size: 0.9rem;
  margin-top: -0.5rem;
  margin-bottom: 2rem;
  font-weight: 500;
}

.re-archive-post-item {
  margin-bottom: 3rem;
}

.re-archive-post-link {
  color: var(--re-blue);
  text-decoration: none;
}

.re-archive-post-date {
  color: var(--re-muted-text);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.re-read-more-link {
  font-weight: 600;
  color: var(--re-red);
  text-decoration: none;
}

.re-read-more-link:hover {
  text-decoration: underline;
}

.re-post-inquiry-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-left: 5px solid var(--re-blue);
  border-radius: var(--re-radius-card);
  padding: 2rem;
  margin-top: 3rem;
  box-shadow: 0 4px 12px rgba(0, 43, 73, 0.05);
}

.re-post-inquiry-box h3 {
  color: var(--re-blue);
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.35rem;
}

.re-post-inquiry-box p {
  color: var(--re-muted-text);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.re-404-text {
  font-size: 1.1rem;
  color: var(--re-muted-text);
  margin-bottom: 2rem;
}

/* Persistent adviser sidebar card */
.re-adviser-sidebar-card {
  background: var(--re-white);
  border: 1px solid #E2E8F0;
  border-top: 4px solid var(--re-blue);
  border-radius: var(--re-radius-card);
  padding: 2rem;
  box-shadow: 0 10px 25px -5px rgba(0, 43, 73, 0.08);
  position: sticky;
  top: 2rem;
}

.re-sidebar-headshot-wrap {
  text-align: center;
  margin-bottom: 1.25rem;
}

.re-sidebar-headshot-wrap .re-headshot-container {
  float: none;
  margin: 0 auto;
  max-width: 180px;
}

.re-sidebar-title {
  color: var(--re-blue);
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 0.25rem;
  text-align: center;
}

.re-sidebar-role {
  color: var(--re-red);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  margin-bottom: 1.25rem;
}

.re-sidebar-bio {
  color: var(--re-muted-text);
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 1.5rem;
  text-align: center;
}

.re-sidebar-credentials {
  list-style: none;
  margin: 0 0 1.75rem 0;
  border-top: 1px solid #E2E8F0;
  border-bottom: 1px solid #E2E8F0;
  padding: 1rem 0;
}

.re-sidebar-credentials li {
  font-size: 0.85rem;
  color: var(--re-dark-text);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.re-sidebar-credentials li:last-child {
  margin-bottom: 0;
}

.re-sidebar-credentials svg {
  color: #8C6D1F;
  flex-shrink: 0;
}

.re-sidebar-cta-btn {
  display: block;
  width: 100%;
  text-align: center;
  background-color: var(--re-red);
  color: var(--re-white);
  padding: 0.85rem 1.25rem;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--re-radius-control);
  text-decoration: none;
  box-sizing: border-box;
  box-shadow: 0 4px 6px -1px rgba(134, 38, 51, 0.25);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.re-sidebar-cta-btn:hover,
.re-sidebar-cta-btn:focus {
  background-color: var(--re-red-hover);
  transform: translateY(-1px);
  text-decoration: none;
}

/* ==========================================================================
   5. NATIVE GUTENBERG BLOCK REFINEMENTS
   ========================================================================== */
.entry-content blockquote,
.wp-block-quote {
  border-left: 4px solid var(--re-red);
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  background-color: var(--re-light-grey);
  border-radius: 0 var(--re-radius-card) var(--re-radius-card) 0;
  font-style: italic;
  color: var(--re-dark-text);
}

.wp-block-quote p {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 0 0.5rem 0;
}

.wp-block-quote cite {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--re-red);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}

.entry-content table,
.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}

.entry-content table th,
.wp-block-table table th {
  background-color: var(--re-blue);
  color: var(--re-white);
  font-weight: 600;
  text-align: left;
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--re-blue);
}

.entry-content table td,
.wp-block-table table td {
  padding: 0.85rem 1.25rem;
  border: 1px solid #CBD5E1;
  color: var(--re-dark-text);
}

.entry-content table tr:nth-child(even),
.wp-block-table table tr:nth-child(even) {
  background-color: #F8FAFC;
}

.wp-block-details {
  border: 1px solid #CBD5E1;
  border-left: 4px solid var(--re-blue);
  border-radius: var(--re-radius-control);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  background: #FFFFFF;
}

.wp-block-details summary {
  font-weight: 600;
  color: var(--re-blue);
  cursor: pointer;
  font-size: 1.05rem;
}

.wp-block-details[open] summary {
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #E2E8F0;
  padding-bottom: 0.5rem;
}

/* ==========================================================================
   6. HOMEPAGE HERO SECTION & TRUST BAR
   ========================================================================== */
.hero-section {
  background: linear-gradient(135deg, rgba(0, 43, 73, 0.05) 0%, rgba(0, 43, 73, 0.02) 100%);
  padding: 3.5rem 2rem 2.5rem;
  text-align: center;
}

.hero-section h1 {
  color: var(--re-blue);
  font-size: 2.75rem;
  max-width: 800px;
  margin: 0 auto 1rem;
  line-height: 1.2;
}

.hero-section p {
  color: var(--re-muted-text);
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 1.75rem;
}

.re-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.85rem 1rem;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--re-red);
  color: var(--re-white);
  border: 2px solid var(--re-red);
  padding: 0.85rem 2rem;
  font-weight: 600;
  border-radius: var(--re-radius-control);
  text-decoration: none;
  box-sizing: border-box;
  box-shadow: 0 4px 6px -1px rgba(134, 38, 51, 0.25);
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.cta-button:hover,
.cta-button:focus {
  background-color: var(--re-red-hover);
  border-color: var(--re-red-hover);
  transform: translateY(-1px);
}

.cta-button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: var(--re-blue);
  border: 2px solid var(--re-blue);
  padding: 0.85rem 2rem;
  font-weight: 600;
  border-radius: var(--re-radius-control);
  text-decoration: none;
  box-sizing: border-box;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cta-button-secondary:hover,
.cta-button-secondary:focus {
  background-color: var(--re-blue);
  color: var(--re-white);
  border-color: var(--re-blue);
  transform: translateY(-1px);
}

.re-trust-bar {
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  border-bottom: 1px solid #E2E8F0;
  padding: 1.25rem 2rem;
}

.re-trust-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.75rem;
}

.re-trust-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.re-trust-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--re-radius-control);
  background: rgba(0, 43, 73, 0.08);
  color: var(--re-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.re-trust-content h3,
.re-trust-content h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.95rem;
  color: var(--re-blue);
  font-family: var(--font-body);
  font-weight: 600;
}

.re-trust-content p {
  margin: 0;
  font-size: 0.825rem;
  color: var(--re-muted-text);
  line-height: 1.4;
}

/* ==========================================================================
   7. HOMEPAGE FEATURE BLOCKS CAROUSEL & ACCESSIBILITY
   ========================================================================== */
.features-carousel-section {
  max-width: 1500px;
  margin: 2.25rem auto 3.75rem;
  padding: 0 2rem;
  position: relative;
  box-sizing: border-box;
}

.features-carousel-container {
  position: relative;
  width: 100%;
  padding: 0 3.25rem;
  box-sizing: border-box;
}

.re-carousel-viewport {
  overflow: hidden;
  width: 100%;
  padding: 0.5rem 0 1rem;
}

.re-carousel-track {
  display: flex;
  gap: 1.5rem;
  transition: transform 0.65s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.re-carousel-track .feature-card {
  flex: 0 0 calc((100% - 3rem) / 3);
  min-width: 0;
  background: var(--re-white);
  padding: 1.5rem 1.75rem 2rem;
  border-radius: var(--re-radius-card);
  border-top: 4px solid var(--re-blue);
  box-shadow: 0 8px 20px -3px rgba(0, 43, 73, 0.07);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.feature-card h3 {
  color: var(--re-blue);
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
  line-height: 1.35;
}

.feature-card h3 a {
  color: var(--re-blue);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.feature-card h3 a:hover,
.feature-card h3 a:focus {
  color: var(--re-red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.feature-card-num {
  color: var(--re-red);
  margin-right: 8px;
  font-weight: 700;
}

.feature-card p,
.feature-card .feature-card-text {
  color: var(--re-muted-text);
  font-size: 0.925rem;
  line-height: 1.55;
  margin-bottom: 0;
}

.re-carousel-arrow {
  position: absolute;
  top: calc(50% - 1.25rem);
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #CBD5E1;
  color: var(--re-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  padding: 0;
}

.re-carousel-arrow:hover,
.re-carousel-arrow:focus {
  background: var(--re-blue);
  color: var(--re-white);
  border-color: var(--re-blue);
  box-shadow: 0 6px 14px rgba(0, 43, 73, 0.2);
}

.re-carousel-arrow:focus-visible,
.re-carousel-dot:focus-visible,
.re-carousel-toggle-btn:focus-visible {
  outline: 2px solid var(--re-blue);
  outline-offset: 2px;
}

.cta-button:focus-visible,
.cta-button-secondary:focus-visible,
.re-sidebar-cta-btn:focus-visible {
  outline: 2px solid var(--re-gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--re-blue);
}

.re-carousel-prev { left: 0; }
.re-carousel-next { right: 0; }

.re-carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-bottom: 0.25rem;
}

.re-carousel-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #CBD5E1;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.re-carousel-dot:hover,
.re-carousel-dot:focus {
  background: #94A3B8;
}

.re-carousel-dot.is-active {
  background: var(--re-gold);
  width: 24px;
  border-radius: 10px;
}

.re-carousel-controls-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.re-carousel-toggle-btn {
  background: var(--re-blue);
  color: var(--re-white);
  border: none;
  padding: 0.35rem 0.85rem;
  border-radius: var(--re-radius-control);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.re-carousel-toggle-btn:hover {
  background: var(--re-red);
}

@media (prefers-reduced-motion: reduce) {
  .re-carousel-track {
    transition: none !important;
  }

  .cta-button,
  .cta-button-secondary,
  .re-sidebar-cta-btn {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  }

  .cta-button:hover,
  .cta-button:focus,
  .cta-button-secondary:hover,
  .cta-button-secondary:focus,
  .re-sidebar-cta-btn:hover,
  .re-sidebar-cta-btn:focus {
    transform: none;
  }
}

/* ==========================================================================
   8. FOOTER SECTION
   ========================================================================== */
.site-footer {
  background-color: #0F172A;
  color: #94A3B8;
  padding: 3rem 2rem;
  text-align: center;
  font-size: 0.875rem;
  border-top: 1px solid #1E293B;
}

.regulatory-disclosure {
  font-size: 0.75rem;
  margin-top: 0.85rem;
  opacity: 0.8;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ==========================================================================
   9. RESPONSIVE TOUCH & MOBILE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1024px) {
  .site-main-with-sidebar {
    grid-template-columns: 1fr 300px;
    gap: 2rem;
  }

  .re-trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .re-carousel-track .feature-card {
    flex: 0 0 calc((100% - 1.5rem) / 2);
  }
}

@media (max-width: 900px) {
  .site-header {
    padding: 1rem 1.5rem;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .main-navigation {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    margin-top: 0;
    z-index: 99999;
  }

  .main-navigation > div > ul,
  .main-navigation > ul {
    display: none;
    flex-direction: column;
    gap: 0;
    background-color: var(--re-blue);
    border-top: 3px solid var(--re-red);
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.35);
  }

  .main-navigation > div > ul.toggled-on,
  .main-navigation > ul.toggled-on {
    display: flex;
  }

  .main-navigation a {
    padding: 1rem 1.25rem;
    display: block;
    color: var(--re-white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: normal;
  }

  .main-navigation > ul > li.current-menu-item > a,
  .main-navigation > ul > li.current-menu-parent > a,
  .main-navigation > ul > li.current-menu-ancestor > a,
  .main-navigation > ul > li.current_page_item > a,
  .main-navigation > ul > li.current_page_parent > a,
  .main-navigation > ul > li.current_page_ancestor > a,
  .main-navigation > div > ul > li.current-menu-item > a,
  .main-navigation > div > ul > li.current-menu-parent > a,
  .main-navigation > div > ul > li.current-menu-ancestor > a,
  .main-navigation > div > ul > li.current_page_item > a,
  .main-navigation > div > ul > li.current_page_parent > a,
  .main-navigation > div > ul > li.current_page_ancestor > a {
    font-weight: 600;
    border-left: 4px solid var(--re-red);
    background-color: rgba(255, 255, 255, 0.06);
  }

  .main-navigation .sub-menu li.current-menu-item > a,
  .main-navigation .sub-menu li.current_page_item > a {
    background-color: var(--re-red);
    font-weight: 600;
  }

  .main-navigation .menu-item-has-children > .sub-menu {
    display: none !important;
    position: static !important;
    box-shadow: none !important;
    border-top: none !important;
    border-left: 4px solid var(--re-red) !important;
    min-width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: var(--re-blue-dark) !important;
    box-sizing: border-box;
  }

  .main-navigation .menu-item-has-children.touch-active > .sub-menu {
    display: flex !important;
    flex-direction: column !important;
  }

  .main-navigation .menu-item-has-children.touch-active > .sub-menu .sub-menu {
    display: flex !important;
    flex-direction: column !important;
    border-left: 2px solid rgba(255, 255, 255, 0.25) !important;
    padding-left: 1rem !important;
    background-color: rgba(0, 0, 0, 0.15) !important;
  }

  .site-main-with-sidebar {
    grid-template-columns: 1fr;
  }

  .re-adviser-sidebar-card {
    position: static;
    margin-top: 2.5rem;
  }

  .hero-section {
    padding: 2.5rem 1rem 2rem;
  }

  .hero-section h1 {
    font-size: 2rem;
  }
}

@media (max-width: 640px) {
  .re-trust-grid {
    grid-template-columns: 1fr;
  }

  .features-carousel-container {
    padding: 0 2.25rem;
  }

  .re-carousel-track .feature-card {
    flex: 0 0 100%;
  }

  .re-carousel-arrow {
    width: 34px;
    height: 34px;
  }
}

/* v5.4.11 additions */
/* ==========================================================================
   10. ACCESSIBLE SCREEN-READER UTILITY & PAGINATION STYLES
   Provides standard WordPress visually-hidden utility class for assistive
   technologies (such as the archive pagination heading and skip links) and
   branded page number buttons for the_posts_pagination().
   ========================================================================== */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--re-red);
  border-radius: 0 0 var(--re-radius-control) 0;
  clip: auto !important;
  clip-path: none;
  color: var(--re-white);
  display: block;
  font-size: 1rem;
  font-weight: 700;
  height: auto;
  left: 0;
  line-height: normal;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  top: 0;
  width: auto;
  z-index: 100000;
  outline: 3px solid var(--re-blue-dark);
}

.navigation.pagination {
  margin-top: 2.5rem;
  text-align: center;
}

.navigation.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.navigation.pagination .page-numbers {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--re-blue);
  border-radius: var(--re-radius-control);
  text-decoration: none;
  color: var(--re-blue);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.navigation.pagination .page-numbers.current,
.navigation.pagination a.page-numbers:hover,
.navigation.pagination a.page-numbers:focus {
  background-color: var(--re-blue);
  color: var(--re-white);
}

.navigation.pagination a.page-numbers:focus {
  outline: 2px solid var(--re-red);
  outline-offset: 2px;
}

.navigation.pagination .page-numbers.dots {
  border: none;
  padding: 0.5rem 0.4rem;
}

/* Footer navigation */
.footer-navigation { text-align: center; margin-bottom: 1.25rem; }
.footer-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem; }
.footer-navigation a { color: inherit; text-decoration: underline; }
.footer-navigation a:hover, .footer-navigation a:focus { text-decoration: none; }

/* ==========================================================================
   v5.4.15 additions (replace former inline style="" attributes)
   ========================================================================== */

/* Space above the "read more" link under each commentary summary (home.php) */
.re-read-more-wrap {
  margin-top: 1rem;
}

/* Homepage hero: white text and white outline button only when a background photo is showing (front-page.php) */
.hero-section.hero-has-image h1 {
  color: #FFFFFF;
}
.hero-section.hero-has-image p {
  color: #E2E8F0;
}
.hero-section.hero-has-image .cta-button-secondary {
  color: var(--re-white);
  border-color: rgba(255, 255, 255, 0.85);
  background-color: rgba(255, 255, 255, 0.08);
}
.hero-section.hero-has-image .cta-button-secondary:hover,
.hero-section.hero-has-image .cta-button-secondary:focus {
  color: var(--re-white);
  border-color: var(--re-white);
  background-color: rgba(255, 255, 255, 0.2);
}
