/**
 * LRXpressway Theme - UI Polish & Editorial Design (Phase 8)
 *
 * Editorial premium design system with:
 * - Serif headlines, sans-serif body
 * - 70ch max line length for readability
 * - Premium cards and components
 * - Sticky header with scroll shadow
 * - Mobile quick links and enhanced nav
 * - Strong visual hierarchy
 *
 * Color tokens reference (from theme.json):
 *   --wp--preset--color--ink: #1a1a2e
 *   --wp--preset--color--slate: #3d3d5c
 *   --wp--preset--color--accent: #9f0e0e
 *   --wp--preset--color--link-blue: #2563eb
 *   --wp--preset--color--gold: #d97706
 *   --wp--preset--color--mist: #f3f4f6
 *   --wp--preset--color--warm-white: #fafaf9
 *   --wp--preset--color--border: #e5e7eb
 */

/* ============================================================================
   CSS CUSTOM PROPERTIES (design tokens)
   ============================================================================ */

:root {
  --lrx-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --lrx-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --lrx-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --lrx-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --lrx-transition-fast: 0.15s ease;
  --lrx-transition-normal: 0.2s ease;
  --lrx-radius-sm: 4px;
  --lrx-radius-md: 8px;
  --lrx-radius-lg: 12px;
  --lrx-radius-xl: 16px;
  --lrx-prose-width: 70ch;
}

/* ============================================================================
   EDITORIAL TYPOGRAPHY - MAX LINE LENGTH
   ============================================================================ */

/* Prose max-width for readability */
.wp-block-post-content > .wp-block-paragraph,
.wp-block-post-content > .wp-block-list,
.wp-block-post-content > .wp-block-quote,
.entry-content > p,
.entry-content > ul,
.entry-content > ol {
  max-width: var(--lrx-prose-width);
}

/* ============================================================================
   VISITED LINKS
   ============================================================================ */

a:visited {
  color: #1e40af;
}

/* ============================================================================
   CARD COMPONENT STYLING - ELEVATED
   ============================================================================ */

.lrx-card,
.wp-block-group.is-style-card {
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--lrx-radius-lg);
  box-shadow: var(--lrx-shadow-sm);
  transition: box-shadow var(--lrx-transition-normal), transform var(--lrx-transition-normal);
  overflow: hidden;
}

.lrx-card:hover,
.wp-block-group.is-style-card:hover {
  box-shadow: var(--lrx-shadow-md);
  transform: translateY(-3px);
}

/* Card with border styling (auto-detect) */
.wp-block-group[style*="border-width"]:not(.has-ink-background-color):not(.has-accent-background-color) {
  border-radius: var(--lrx-radius-lg);
  overflow: hidden;
  transition: box-shadow var(--lrx-transition-normal);
}

.wp-block-group[style*="border-width"]:not(.has-ink-background-color):not(.has-accent-background-color):hover {
  box-shadow: var(--lrx-shadow-sm);
}

/* ============================================================================
   CALLOUT/BANNER COMPONENT
   ============================================================================ */

.lrx-callout,
.wp-block-group.is-style-callout {
  background: var(--wp--preset--color--callout);
  border-left: 4px solid var(--wp--preset--color--callout-border);
  border-radius: 0 var(--lrx-radius-md) var(--lrx-radius-md) 0;
  padding: 1.5rem 2rem;
}

.lrx-callout p:last-child,
.wp-block-group.is-style-callout p:last-child {
  margin-bottom: 0;
}

/* Info callout variant */
.lrx-callout--info {
  background: var(--wp--preset--color--info-bg);
  border-left-color: var(--wp--preset--color--info-border);
}

/* ============================================================================
   BUTTON ENHANCEMENTS
   ============================================================================ */

.wp-block-button a,
.wp-element-button {
  box-shadow: var(--lrx-shadow-sm);
  transition: all var(--lrx-transition-fast);
}

.wp-block-button a:hover,
.wp-element-button:hover {
  box-shadow: var(--lrx-shadow-md);
  transform: translateY(-2px);
}

.wp-block-button a:active,
.wp-element-button:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Outline button style */
.wp-block-button.is-style-outline .wp-block-button__link {
  border: 2px solid currentColor;
  background: transparent;
  box-shadow: none;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--wp--preset--color--mist);
  box-shadow: none;
  transform: none;
}

/* ============================================================================
   STICKY HEADER WITH SCROLL SHADOW
   ============================================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow var(--lrx-transition-normal), border-color var(--lrx-transition-normal);
  background: rgba(250, 250, 249, 0.98) !important;
}

.site-header.scrolled {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-bottom-color: transparent !important;
}

/* Site title in light header */
.wp-block-site-title a {
  text-decoration: none !important;
  color: var(--wp--preset--color--ink) !important;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: color var(--lrx-transition-fast);
}

.wp-block-site-title a:hover {
  color: var(--wp--preset--color--accent) !important;
}

/* ============================================================================
   DESKTOP NAVIGATION - VISIBLE MENU (LIGHT HEADER)
   ============================================================================ */

@media (min-width: 1024px) {
  /* Ensure nav stays in one line */
  .wp-block-navigation {
    flex-wrap: nowrap !important;
  }

  .wp-block-navigation ul {
    flex-wrap: nowrap !important;
  }

  /* Desktop nav links in light header */
  .wp-block-navigation a {
    color: var(--wp--preset--color--slate) !important;
    text-decoration: none !important;
    padding: 0.5rem 0.75rem;
    border-radius: var(--lrx-radius-sm);
    transition: color var(--lrx-transition-fast), background var(--lrx-transition-fast);
    white-space: nowrap;
    font-size: 1rem !important;
    letter-spacing: 0.005em;
  }

  .wp-block-navigation a:hover {
    color: var(--wp--preset--color--accent) !important;
    background: var(--wp--preset--color--mist);
  }

  .wp-block-navigation a:focus-visible {
    outline: 2px solid var(--wp--preset--color--accent);
    outline-offset: 2px;
  }

  /* Parent items with submenus - add hover bridge padding */
  .wp-block-navigation-item.has-child {
    position: relative;
  }

  .wp-block-navigation-item.has-child > .wp-block-navigation-item__content {
    padding-bottom: 1rem;
    margin-bottom: -0.5rem;
  }

  /* Desktop submenu dropdown styling - no gap for hover bridge */
  .wp-block-navigation__submenu-container {
    background: var(--wp--preset--color--white) !important;
    border: 1px solid var(--wp--preset--color--border);
    border-radius: var(--lrx-radius-lg);
    box-shadow: var(--lrx-shadow-lg);
    padding: 0.5rem 0 !important;
    min-width: 220px;
    margin-top: 0 !important;
    padding-top: 0.75rem !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--lrx-transition-fast), visibility var(--lrx-transition-fast);
    pointer-events: none;
  }

  /* Show submenu on hover and focus-within */
  .wp-block-navigation-item.has-child:hover > .wp-block-navigation__submenu-container,
  .wp-block-navigation-item.has-child:focus-within > .wp-block-navigation__submenu-container {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Keep submenu open when hovering the submenu itself */
  .wp-block-navigation__submenu-container:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .wp-block-navigation__submenu-container a {
    color: var(--wp--preset--color--ink) !important;
    padding: 0.75rem 1.25rem !important;
    display: block;
    width: 100%;
    min-height: 44px;
    font-size: 0.9375rem;
    border-radius: 0 !important;
    background: transparent !important;
    white-space: normal;
  }

  .wp-block-navigation__submenu-container a:hover {
    color: var(--wp--preset--color--accent) !important;
    background: var(--wp--preset--color--mist) !important;
  }
}

/* Tablet navigation - keep inline where possible */
@media (min-width: 782px) and (max-width: 1023px) {
  .wp-block-navigation a {
    color: var(--wp--preset--color--slate) !important;
    text-decoration: none !important;
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
  }

  .wp-block-navigation a:hover {
    color: var(--wp--preset--color--accent) !important;
  }

  .wp-block-navigation__submenu-container {
    background: var(--wp--preset--color--white) !important;
    border: 1px solid var(--wp--preset--color--border);
    border-radius: var(--lrx-radius-md);
    box-shadow: var(--lrx-shadow-lg);
    padding: 0.5rem 0 !important;
    margin-top: 0 !important;
  }

  .wp-block-navigation__submenu-container a {
    color: var(--wp--preset--color--ink) !important;
    padding: 0.625rem 1rem !important;
    font-size: 0.875rem;
    min-height: 44px;
    display: block;
    width: 100%;
  }
}

/* Navigation gap */
.wp-block-navigation {
  gap: 0.25rem;
}

.wp-block-navigation ul {
  gap: 0.25rem;
}

/* ============================================================================
   MOBILE NAVIGATION
   ============================================================================ */

@media (max-width: 781px) {
  /* Header: brand left, hamburger right */
  .site-header > .wp-block-group {
    flex-direction: row;
    justify-content: space-between;
  }

  /* The hamburger open button - now dark on light background */
  .wp-block-navigation__responsive-container-open {
    color: var(--wp--preset--color--ink) !important;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--lrx-transition-fast);
  }

  .wp-block-navigation__responsive-container-open:hover {
    color: var(--wp--preset--color--accent) !important;
  }

  .wp-block-navigation__responsive-container-open svg {
    fill: currentColor;
    width: 24px;
    height: 24px;
  }

  /* Site title: anchored left, natural size */
  .wp-block-site-title {
    flex: 0 0 auto;
  }

  /* Overlay panel background */
  .wp-block-navigation__responsive-container.is-menu-open {
    padding-top: 0;
    background: var(--wp--preset--color--white) !important;
  }

  /* Close button styling */
  .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
    min-width: 48px;
    min-height: 48px;
    color: var(--wp--preset--color--ink);
    margin: 0.5rem 0.5rem 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--lrx-radius-sm);
    transition: background var(--lrx-transition-fast);
  }

  /* Scrollable content area */
  .wp-block-navigation__responsive-container-content {
    overflow-y: auto;
    max-height: calc(100vh - 60px);
    padding: 0.5rem 0 1.5rem;
  }

  /* Full-width navigation items */
  .wp-block-navigation-item {
    width: 100% !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Full-width tap target links */
  .wp-block-navigation-item__content,
  .wp-block-navigation-item > a,
  .wp-block-navigation-link > a {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.875rem 1.5rem !important;
    min-height: 48px !important;
    text-decoration: none !important;
    color: var(--wp--preset--color--ink) !important;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 1px solid var(--wp--preset--color--border);
    transition: background var(--lrx-transition-fast), color var(--lrx-transition-fast);
  }

  .wp-block-navigation-item > a:hover,
  .wp-block-navigation-item__content:hover,
  .wp-block-navigation-link > a:hover {
    background-color: var(--wp--preset--color--mist);
    color: var(--wp--preset--color--accent) !important;
  }

  /* Submenu group label */
  .wp-block-navigation-submenu > .wp-block-navigation-item__content {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--wp--preset--color--muted) !important;
    padding: 1.125rem 1.5rem 0.625rem !important;
    border-bottom: none;
    min-height: auto !important;
    cursor: default;
  }

  /* Submenu containers */
  .wp-block-navigation__submenu-container {
    width: 100% !important;
    position: static !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
  }

  /* Submenu item full-width tap targets with visual indent */
  .wp-block-navigation__submenu-container .wp-block-navigation-item__content,
  .wp-block-navigation__submenu-container .wp-block-navigation-item > a,
  .wp-block-navigation__submenu-container .wp-block-navigation-link > a {
    padding: 0.75rem 1.5rem 0.75rem 3rem !important;
    min-height: 44px !important;
    color: var(--wp--preset--color--slate) !important;
    font-size: 0.9375rem;
    font-weight: 400;
    border-bottom: 1px solid var(--wp--preset--color--mist);
  }

  .wp-block-navigation__submenu-container .wp-block-navigation-item > a:hover {
    color: var(--wp--preset--color--accent) !important;
    background: var(--wp--preset--color--mist);
  }

  /* Last submenu item border */
  .wp-block-navigation__submenu-container .wp-block-navigation-item:last-child > a {
    border-bottom: 1px solid var(--wp--preset--color--border);
  }

  /* Focus states for accessibility */
  .wp-block-navigation-item__content:focus,
  .wp-block-navigation-item > a:focus {
    outline: 2px solid var(--wp--preset--color--accent);
    outline-offset: -2px;
    background-color: rgba(159, 14, 14, 0.06);
  }

  /* Columns stack with breathing room */
  .wp-block-columns {
    gap: 1.5rem !important;
  }
}

/* Desktop nav resets */
@media (min-width: 782px) {
  .wp-block-navigation-item {
    margin: 0 !important;
    padding: 0 !important;
  }

  .wp-block-navigation-item__content,
  .wp-block-navigation-item > a {
    min-height: auto;
    border-bottom: none;
  }

  .wp-block-navigation__submenu-container .wp-block-navigation-item {
    padding-left: 0 !important;
  }
}

/* ============================================================================
   MOBILE QUICK LINKS - VISIBILITY
   ============================================================================ */

/* Show on mobile/tablet only */
.mobile-quick-links {
  display: block;
}

@media (min-width: 1024px) {
  .mobile-quick-links {
    display: none;
  }
}

/* ============================================================================
   FOOTER STYLING (dark ink background)
   ============================================================================ */

/* Footer links - targets dark-background sections like footer */
.wp-block-group.has-ink-background-color:not(.site-header) a {
  color: #cbd5e1 !important;
  text-decoration: none;
  transition: color var(--lrx-transition-fast);
}

.wp-block-group.has-ink-background-color:not(.site-header) a:hover {
  color: #fff !important;
  text-decoration: underline;
}

.wp-block-group.has-ink-background-color:not(.site-header) a:focus-visible {
  outline: 2px solid var(--wp--preset--color--gold);
  outline-offset: 2px;
}

.footer-links {
  list-style: none !important;
  padding-left: 0 !important;
}

/* ============================================================================
   TABLE OF CONTENTS
   ============================================================================ */

.lrx-toc .toc-list {
  list-style: none !important;
  padding-left: 0 !important;
  margin: 0;
}

.lrx-toc .toc-list li {
  padding: 0;
  border-bottom: 1px solid var(--wp--preset--color--border-soft);
}

.lrx-toc .toc-list li:last-child {
  border-bottom: none;
}

.lrx-toc .toc-list a {
  display: block;
  padding: 0.625rem 0;
  text-decoration: none;
  color: var(--wp--preset--color--link-blue);
  font-weight: 500;
  transition: color var(--lrx-transition-fast);
}

.lrx-toc .toc-list a:hover {
  color: var(--wp--preset--color--accent);
}

/* ============================================================================
   DIRECTORY LINK LISTS
   ============================================================================ */

.directory-links {
  list-style: none !important;
  padding-left: 0 !important;
}

.directory-links li {
  border-bottom: 1px solid var(--wp--preset--color--border);
  padding: 0.875rem 0;
}

.directory-links li:last-child {
  border-bottom: none;
}

.directory-links a {
  text-decoration: none;
  color: var(--wp--preset--color--link-blue);
  transition: color var(--lrx-transition-fast);
}

.directory-links a:hover {
  color: var(--wp--preset--color--accent);
  text-decoration: underline;
}

/* ============================================================================
   DOCUMENT/FILE LIST STYLING
   ============================================================================ */

.lrx-document-list {
  list-style: none !important;
  padding-left: 0 !important;
  margin: 0;
}

.lrx-document-list li {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--lrx-radius-md);
  margin-bottom: 0.625rem;
  background: var(--wp--preset--color--white);
  transition: border-color var(--lrx-transition-fast), box-shadow var(--lrx-transition-fast);
}

.lrx-document-list li:hover {
  border-color: var(--wp--preset--color--border-dark);
  box-shadow: var(--lrx-shadow-sm);
}

.lrx-document-list li::before {
  content: "";
  display: block;
  width: 20px;
  height: 24px;
  background: var(--wp--preset--color--accent);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm4 18H6V4h7v5h5v11z'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  flex-shrink: 0;
}

.lrx-document-list a {
  color: var(--wp--preset--color--link-blue);
  text-decoration: none;
  font-weight: 500;
}

.lrx-document-list a:hover {
  color: var(--wp--preset--color--accent);
  text-decoration: underline;
}

/* File block styling */
.wp-block-file {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--lrx-radius-md);
  background: var(--wp--preset--color--white);
}

/* ============================================================================
   TOUCH TARGET SIZING
   ============================================================================ */

a:not(p a):not(li a):not(span a):not(td a):not(.wp-block-post-title a):not(.directory-links a):not(.footer-links a):not(.wp-block-navigation a):not(.toc-list a) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Inline links stay inline */
p > a,
li > a,
span > a,
td > a,
.wp-block-post-title a,
.directory-links a,
.footer-links a,
.toc-list a {
  display: inline;
  min-height: auto;
  padding: 0;
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 2px;
}

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

  .wp-block-button a,
  .wp-element-button,
  .lrx-card,
  .wp-block-group.is-style-card {
    transform: none !important;
  }
}

/* ============================================================================
   FORM ELEMENTS
   ============================================================================ */

input[type="text"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select {
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--lrx-radius-md);
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color var(--lrx-transition-fast), box-shadow var(--lrx-transition-fast);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
  border-color: var(--wp--preset--color--accent);
  box-shadow: 0 0 0 3px rgba(159, 14, 14, 0.1);
  outline: none;
}

/* ============================================================================
   IMAGE CAPTIONS
   ============================================================================ */

.wp-block-image figcaption {
  font-size: 0.8125rem;
  color: var(--wp--preset--color--muted);
  margin-top: 0.625rem;
  text-align: center;
  font-style: italic;
}

/* ============================================================================
   SEPARATOR
   ============================================================================ */

.wp-block-separator {
  border-top-width: 1px !important;
  opacity: 1;
}

.wp-block-separator.is-style-wide {
  border-top-width: 1px !important;
}

/* ============================================================================
   POST TITLE LINKS
   ============================================================================ */

.wp-block-post-title a {
  text-decoration: none;
  color: var(--wp--preset--color--ink);
  transition: color var(--lrx-transition-fast);
}

.wp-block-post-title a:hover {
  color: var(--wp--preset--color--accent);
}

/* ============================================================================
   TABLE STYLING
   ============================================================================ */

.wp-block-table table {
  border-collapse: collapse;
  width: 100%;
}

.wp-block-table th,
.wp-block-table td {
  padding: 0.875rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--wp--preset--color--border);
}

.wp-block-table th {
  font-weight: 600;
  background: var(--wp--preset--color--mist);
  color: var(--wp--preset--color--ink);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wp-block-table tr:hover td {
  background: rgba(243, 244, 246, 0.5);
}

/* ============================================================================
   COVER BLOCK ENHANCEMENTS
   ============================================================================ */

.wp-block-cover {
  overflow: hidden;
}

.wp-block-cover__inner-container {
  max-width: 100%;
}

/* ============================================================================
   SECTION SPACING
   ============================================================================ */

/* Consistent section rhythm */
.wp-block-group[style*="padding-top:80px"],
.wp-block-group[style*="padding-top: 80px"] {
  margin-top: 0;
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
  .wp-block-navigation,
  .wp-block-buttons,
  [role="navigation"],
  .site-header,
  .mobile-quick-links {
    display: none;
  }

  body {
    color: black;
    background: white;
  }

  a {
    color: inherit;
    text-decoration: underline;
  }

  .lrx-card,
  .wp-block-group.is-style-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .wp-block-cover {
    background: #f0f0f0 !important;
  }

  .wp-block-cover__background {
    display: none;
  }
}

/* ============================================================================
   HEADER SCROLL SHADOW (JavaScript Enhancement)
   ============================================================================ */

/* Add via JS: document.querySelector('.site-header').classList.toggle('scrolled', window.scrollY > 10) */

/* ============================================================================
   EDITORIAL POLISH - LIGHT FOOTER
   ============================================================================ */

.site-footer {
  border-top: 1px solid var(--wp--preset--color--border);
}

.footer-links-light {
  list-style: none !important;
  padding-left: 0 !important;
  margin: 0;
}

.footer-links-light li {
  margin: 0;
}

.footer-links-light a {
  color: var(--wp--preset--color--slate) !important;
  text-decoration: none;
  transition: color var(--lrx-transition-fast);
}

.footer-links-light a:hover {
  color: var(--wp--preset--color--accent) !important;
  text-decoration: underline;
}

.footer-links-light a:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 2px;
}

/* ============================================================================
   EDITORIAL CTA - ACTION CARDS (legacy class — kept for compatibility)
   ============================================================================ */

.cta-action-card {
  transition: border-color var(--lrx-transition-fast), box-shadow var(--lrx-transition-fast), transform var(--lrx-transition-fast);
  cursor: pointer;
}

.cta-action-card:hover {
  border-color: var(--wp--preset--color--accent) !important;
  box-shadow: var(--lrx-shadow-sm);
  transform: translateY(-2px);
}

/* ============================================================================
   STAY CONNECTED INFO STACK — static cards (plain HTML, no WP layout classes)
   ============================================================================ */

.lrx-stay-info-stack {
  width: 100%;
  max-width: 380px;
  margin: 1.5rem 0 0 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

.lrx-stay-info-card {
  width: 100%;
  margin: 0 !important;
  padding: 1.1rem 1.25rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: #fff;
  cursor: default !important;
  pointer-events: none;
  transition: none !important;
  transform: none !important;
  box-shadow: none;
}

.lrx-stay-info-card:hover,
.lrx-stay-info-card:focus,
.lrx-stay-info-card:active {
  border-color: rgba(15, 23, 42, 0.12) !important;
  box-shadow: none !important;
  transform: none !important;
  cursor: default !important;
}

.lrx-stay-info-card h3 {
  margin: 0 0 4px 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

.lrx-stay-info-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--wp--preset--color--muted);
  line-height: 1.5;
}

/* Button row aligned flush left with heading/cards */
.lrx-stay-connected-buttons,
.lrx-stay-connected-buttons.wp-block-buttons {
  justify-content: flex-start !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* ============================================================================
   HEADER LAYOUT — TITLE FAR LEFT, NAV CENTERED
   The outer .site-header has layout:constrained; WordPress injects
   max-width and margin:auto !important on direct children via :where().
   We target the inner row (.site-header > .wp-block-group) directly and
   override both max-width and auto margins so the row fills the header bar.
   At 900px+ we switch to a 3-column grid so the nav is truly centered.
   Mobile (<782px) keeps the existing flex row-reverse / hamburger behavior.
   ============================================================================ */

/* All non-mobile: lift the constrained-layout cap and add side padding */
@media (min-width: 782px) {
  .site-header > .wp-block-group {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: clamp(1.25rem, 3vw, 3rem) !important;
    padding-right: clamp(1.25rem, 3vw, 3rem) !important;
  }

  /* Site title: 1.375rem bold */
  .wp-block-site-title a {
    font-size: 1.375rem !important;
  }

  /* Nav links: readable 1rem */
  .site-header .wp-block-navigation .wp-block-navigation-item__content,
  .site-header .wp-block-navigation a:not(.wp-block-navigation__submenu-container a) {
    font-size: 1rem !important;
    letter-spacing: 0.005em;
  }
}

/* Desktop 900px+: 3-column grid — brand column 1 (far left), nav column 2
   (auto-centered between equal 1fr flanks), spacer column 3 (invisible) */
@media (min-width: 900px) {
  .site-header > .wp-block-group {
    display: grid !important;
    grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr) !important;
    align-items: center !important;
    gap: 0 !important;
  }

  /* Brand anchored far left */
  .site-header .wp-block-site-title {
    grid-column: 1 !important;
    justify-self: start !important;
    flex: none !important;
    white-space: nowrap;
    margin: 0 !important;
  }

  /* Nav centered across full header bar */
  .site-header .wp-block-navigation {
    grid-column: 2 !important;
    justify-self: center !important;
    flex: none !important;
    margin: 0 !important;
  }
  /* Column 3 is the implicit balancing spacer */
}

/* ============================================================================
   INNER PAGE HERO
   ============================================================================ */

.inner-page-hero {
  border-bottom: 1px solid var(--wp--preset--color--border);
}

.breadcrumb-row a {
  text-decoration: none;
  transition: color var(--lrx-transition-fast);
}

.breadcrumb-row a:hover {
  text-decoration: underline;
}

/* ============================================================================
   KEY TAKEAWAYS CARD
   ============================================================================ */

.key-takeaways-card {
  box-shadow: var(--lrx-shadow-sm);
}

.takeaways-list {
  list-style: none !important;
  margin: 0;
}

.takeaways-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
}

.takeaways-list li:last-child {
  margin-bottom: 0;
}

.takeaways-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 16px;
  height: 16px;
  background: var(--wp--preset--color--accent);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
  mask-size: contain;
}

/* ============================================================================
   SECTION DIVIDER - EDITORIAL
   ============================================================================ */

.section-divider-editorial hr {
  border: none !important;
  height: 2px !important;
  opacity: 1 !important;
}

/* ============================================================================
   EDITORIAL LINK STYLING
   ============================================================================ */

/* Body content links - intentional underline style */
.wp-block-post-content a:not(.wp-block-button__link),
.entry-content a:not(.wp-block-button__link) {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--lrx-transition-fast), text-decoration-color var(--lrx-transition-fast);
}

.wp-block-post-content a:not(.wp-block-button__link):hover,
.entry-content a:not(.wp-block-button__link):hover {
  text-decoration-thickness: 2px;
}

/* ============================================================================
   BUTTON HIERARCHY
   ============================================================================ */

/* Primary button (accent) - already styled */

/* Secondary button (outline) */
.wp-block-button.is-style-outline .wp-block-button__link {
  border-width: 2px;
  border-color: var(--wp--preset--color--ink);
  color: var(--wp--preset--color--ink);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--wp--preset--color--ink);
  color: var(--wp--preset--color--white);
  border-color: var(--wp--preset--color--ink);
}

/* Ghost/text button style */
.wp-block-button.is-style-ghost .wp-block-button__link {
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--wp--preset--color--link-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding-left: 0;
  padding-right: 0;
}

.wp-block-button.is-style-ghost .wp-block-button__link:hover {
  color: var(--wp--preset--color--accent);
  transform: none;
  box-shadow: none;
}

/* ============================================================================
   CONSISTENT SECTION SPACING
   ============================================================================ */

/* Ensure consistent vertical rhythm between major sections */
.wp-block-group + .wp-block-group {
  margin-top: 0;
}

/* Inner page content spacing */
.wp-block-post-content > *:first-child {
  margin-top: 0;
}

.wp-block-post-content > .wp-block-heading {
  margin-top: 2.5rem;
}

.wp-block-post-content > .wp-block-heading:first-child {
  margin-top: 0;
}

/* ============================================================================
   PAGE INTRO STYLING
   ============================================================================ */

.page-intro {
  max-width: 70ch;
}

/* ============================================================================
   HERO — DEFINITIVE VISUAL FIX (Phase 14)
   ============================================================================ */

/*
 * Three-strategy selector group — fires if ANY condition is true:
 *   A) .lrx-hero-primary class present (file-based template render)
 *   B) :has([src*="hero-1"]) — cover block contains an image with "hero-1"
 *      in the src URL. Matches hero-1.svg AND hero-1-v2.svg regardless of
 *      whether the template is served from files or the database.
 *   C) Structural fallback: first .wp-block-cover.alignfull inside the
 *      main page group (catches any remaining edge cases)
 *
 * LAYER 1 — Cover background gradient (warm editorial palette):
 *   Sets the cover DIV's own CSS background. WordPress's inline
 *   background-color:rgba(0,0,0,0) has no !important, so our !important
 *   rule wins. The gradient shows through wherever the SVG image is
 *   semi-transparent (via LAYER 2 below).
 */
.lrx-hero-primary.wp-block-cover,
.wp-block-cover.alignfull:has(.wp-block-cover__image-background[src*="hero-1"]),
.wp-block-group > .wp-block-cover.alignfull:first-child {
  background: linear-gradient(
    160deg,
    #2a5270  0%,   /* deep slate-blue — upper left sky */
    #3f7090  22%,  /* muted blue     */
    #6898b0  45%,  /* light blue-gray — mid sky */
    #c28d60  70%,  /* warm amber/gold — horizon glow */
    #7a4e2a 100%   /* deep terra — foreground */
  ) !important;
  overflow: hidden;
}

/*
 * LAYER 2 — Reduce SVG image opacity so the warm gradient above shows through.
 * At opacity 0.22 the dark SVG silhouettes remain faintly visible (adds
 * texture/depth) but the warm CSS gradient dominates the color.
 */
.lrx-hero-primary .wp-block-cover__image-background,
.wp-block-cover.alignfull:has(.wp-block-cover__image-background[src*="hero-1"]) .wp-block-cover__image-background,
.wp-block-group > .wp-block-cover.alignfull:first-child .wp-block-cover__image-background {
  opacity: 0.22 !important;
}

/*
 * LAYER 3 — Bottom-weighted overlay gradient replaces the flat dim.
 * Bottom zone (text area): very dark → white text contrast ≥ 7:1.
 * Upper zone: nearly transparent → warm CSS gradient fully visible.
 */
.lrx-hero-primary .wp-block-cover__background,
.wp-block-cover.alignfull:has(.wp-block-cover__image-background[src*="hero-1"]) .wp-block-cover__background,
.wp-block-group > .wp-block-cover.alignfull:first-child .wp-block-cover__background {
  background: linear-gradient(
    to top,
    rgba(15, 28, 50, 0.92)  0%,   /* very dark bottom — text zone   */
    rgba(15, 28, 50, 0.58)  28%,  /* medium-dark                     */
    rgba(15, 28, 50, 0.18)  60%,  /* light — warm gradient visible   */
    rgba(15, 28, 50, 0.00) 100%   /* transparent — full sky visible  */
  ) !important;
  opacity: 1 !important;
}

/* Mobile: frosted text panel + compact height */
@media (max-width: 781px) {
  .lrx-hero-primary.wp-block-cover,
  .wp-block-cover.alignfull:has(.wp-block-cover__image-background[src*="hero-1"]),
  .wp-block-group > .wp-block-cover.alignfull:first-child {
    min-height: 480px !important;
  }

  .lrx-hero-primary .wp-block-cover__inner-container > .wp-block-group,
  .wp-block-cover.alignfull:has(.wp-block-cover__image-background[src*="hero-1"]) .wp-block-cover__inner-container > .wp-block-group,
  .wp-block-group > .wp-block-cover.alignfull:first-child .wp-block-cover__inner-container > .wp-block-group {
    background: rgba(15, 28, 50, 0.55) !important;
    border-radius: 10px;
    padding: 1.5rem !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

/* Reduced-motion: skip backdrop-filter */
@media (prefers-reduced-motion: reduce) {
  .lrx-hero-primary .wp-block-cover__inner-container > .wp-block-group,
  .wp-block-cover.alignfull:has(.wp-block-cover__image-background[src*="hero-1"]) .wp-block-cover__inner-container > .wp-block-group {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* ============================================================================
   HOMEPAGE STATS BAR (Phase 13 polish)
   ============================================================================ */

/*
 * Subtle accent top-rule to cleanly separate hero from the stats strip.
 * The warm-white background already creates a tonal break; the 3px rule
 * adds a purposeful editorial detail without being heavy.
 */
.lrx-stats-bar {
  border-top: 3px solid var(--wp--preset--color--accent);
  box-shadow: 0 -1px 0 0 var(--wp--preset--color--border);
}

/* Mobile: stack stats and remove right-border dividers between items */
@media (max-width: 600px) {
  .lrx-stats-bar .wp-block-column[style*="border-right"] {
    border-right: none !important;
    padding-right: 0 !important;
    border-bottom: 1px solid var(--wp--preset--color--border);
    padding-bottom: 20px !important;
    margin-bottom: 4px;
  }
}

/* ============================================================================
   DETOURS / ALERTS CALLOUT — EDITORIAL SOFTENING (Phase 13 polish)
   ============================================================================ */

/*
 * The default callout color (#fef3c7 + #f59e0b border) reads as "alert yellow."
 * We soften it to a tinted-parchment feel with a left-accent stripe,
 * keeping the warning semantics but making it feel more editorial.
 */
.lrx-alert-editorial.wp-block-group {
  background-color: rgba(254, 243, 199, 0.45) !important;
  border-color: transparent !important;
  border-left: 4px solid var(--wp--preset--color--gold) !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
  border-radius: 0 10px 10px 0 !important;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.18);
}

/* ============================================================================
   UPDATES CARDS — EQUAL HEIGHT COLUMNS (Phase 13 polish)
   ============================================================================ */

/*
 * Make update teaser cards stretch to equal height so the "Read more →"
 * links align to the same baseline across the three columns.
 */
.wp-block-columns:has(> .wp-block-column > .lrx-card) {
  align-items: stretch;
}

.wp-block-columns:has(> .wp-block-column > .lrx-card) > .wp-block-column {
  display: flex;
  flex-direction: column;
}

.wp-block-columns:has(> .wp-block-column > .lrx-card) > .wp-block-column > .lrx-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Push the "Read more" paragraph to the bottom of each card */
.lrx-card.wp-block-group > .wp-block-paragraph:last-of-type {
  margin-top: auto !important;
  padding-top: 0.5rem;
}

/* ============================================================================
   ACCESSIBILITY — SKIP LINK
   Visually hidden at rest; revealed only when keyboard-focused.
   The clip/clip-path approach is more robust than top:-40px (which
   can still be visible if the header doesn't clip overflow).
   ============================================================================ */

.skip-link {
  position: absolute !important;
  top: auto !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  z-index: 10000;
  padding: 8px 16px;
  background: var(--wp--preset--color--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 4px 4px;
}

.skip-link:focus,
.skip-link:focus-visible {
  position: fixed !important;
  top: 0 !important;
  left: 50% !important;
  transform: translateX(-50%);
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
  white-space: normal !important;
  outline: 3px solid rgba(255, 255, 255, 0.9) !important;
  outline-offset: -4px !important;
  text-decoration: underline;
}

/* ============================================================================
   ACCESSIBILITY — BUTTON FOCUS STATES (Phase 13 polish)
   ============================================================================ */

/*
 * When a button receives keyboard focus, show a clear ring WITHOUT
 * the lift transform (transform + outline can clash visually).
 */
.wp-block-button a:focus-visible,
.wp-element-button:focus-visible {
  outline: 3px solid var(--wp--preset--color--accent);
  outline-offset: 3px;
  transform: none !important;
  box-shadow: 0 0 0 5px rgba(159, 14, 14, 0.18) !important;
}

/* Ghost button variant: use link-blue for focus ring (no red accent bg) */
.wp-block-button.is-style-ghost .wp-block-button__link:focus-visible {
  outline-color: var(--wp--preset--color--link-blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18) !important;
}

/* Card "Read more" links */
.lrx-card a:focus-visible,
p a:focus-visible {
  outline: 2px solid var(--wp--preset--color--link-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================================================
   ACCESSIBILITY — REDUCED MOTION ADDITIONS (Phase 13 polish)
   ============================================================================ */

/*
 * In addition to the existing animation/transition suppression, also:
 *   - Disable smooth-scrolling  (scroll-behavior)
 *   - Remove backdrop-filter on sticky header (can cause jank)
 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  .site-header {
    transition: none !important;
  }
}

/* ============================================================================
   DOC CARDS — AUTO-PLACED PDF SECTIONS  (Phase 11 polish)
   Scoped to .lrx-docs--auto so global wp:file blocks are unaffected.
   Also applied to .lrx-docs (hand-crafted env-studies sections).
   ============================================================================ */

/*
 * Each wp:file block becomes a card: border, radius, shadow, padding.
 * Flexbox keeps the title text on the left and the Download button on the right.
 */
.lrx-docs--auto .wp-block-file,
.lrx-docs .wp-block-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.125rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  margin-block-end: 0.625rem !important;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.lrx-docs--auto .wp-block-file:hover,
.lrx-docs .wp-block-file:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.09), 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* File title link — takes up available space, no default bottom margin */
.lrx-docs--auto .wp-block-file > a:not(.wp-block-file__button),
.lrx-docs .wp-block-file > a:not(.wp-block-file__button) {
  flex: 1 1 auto;
  min-width: 0;          /* allow long titles to truncate if needed */
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--wp--preset--color--ink);
  text-decoration: none;
  line-height: 1.4;
  word-break: break-word;
  margin: 0 !important;
}

.lrx-docs--auto .wp-block-file > a:not(.wp-block-file__button):hover,
.lrx-docs .wp-block-file > a:not(.wp-block-file__button):hover {
  text-decoration: underline;
  color: var(--wp--preset--color--accent);
}

/* Download button — accent background, white text, never wraps */
.lrx-docs--auto .wp-block-file .wp-block-file__button,
.lrx-docs .wp-block-file .wp-block-file__button {
  flex: 0 0 auto;
  background-color: var(--wp--preset--color--accent) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 4px !important;
  padding: 0.4rem 0.85rem !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-decoration: none !important;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.lrx-docs--auto .wp-block-file .wp-block-file__button:hover,
.lrx-docs .wp-block-file .wp-block-file__button:hover {
  background-color: color-mix(in srgb, var(--wp--preset--color--accent) 85%, black) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  color: #ffffff !important;
}

.lrx-docs--auto .wp-block-file .wp-block-file__button:focus-visible,
.lrx-docs .wp-block-file .wp-block-file__button:focus-visible {
  outline: 3px solid var(--wp--preset--color--accent);
  outline-offset: 3px;
  color: #ffffff !important;
}

/* Section heading spacing */
.lrx-docs--auto > .wp-block-heading,
.lrx-docs > .wp-block-heading {
  margin-block-end: 0.5rem !important;
}

.lrx-docs--auto > p,
.lrx-docs > p {
  margin-block-end: 1rem !important;
  font-size: 0.9375rem;
  color: var(--wp--preset--color--slate);
}

/* Mobile: stack title above button; button fills full width */
@media (max-width: 600px) {
  .lrx-docs--auto .wp-block-file,
  .lrx-docs .wp-block-file {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.625rem;
  }

  .lrx-docs--auto .wp-block-file .wp-block-file__button,
  .lrx-docs .wp-block-file .wp-block-file__button {
    width: 100% !important;
    justify-content: center;
    text-align: center;
  }
}

/* Reduced-motion: skip hover transitions in doc card section */
@media (prefers-reduced-motion: reduce) {
  .lrx-docs--auto .wp-block-file,
  .lrx-docs .wp-block-file,
  .lrx-docs--auto .wp-block-file .wp-block-file__button,
  .lrx-docs .wp-block-file .wp-block-file__button {
    transition: none !important;
  }
}

/* Project Map embed polish */
.lrx-map-embed {
  margin-top: 1.25rem;
  margin-bottom: 2rem;
}

.lrx-map-embed .lmec-project-map {
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

/* Give the iframe a nicer “panel” height across devices */
.lrx-map-embed .lmec-project-map iframe {
  width: 100% !important;
  height: min(70vh, 680px) !important;
  display: block;
}

@media (max-width: 600px) {
  .lrx-map-embed .lmec-project-map iframe {
    height: 60vh !important;
  }
}

/* Crop Google My Maps header (owner line) */
.lrx-map-embed .lmec-project-map {
  position: relative;
}

.lrx-map-embed .lmec-project-map iframe {
  position: relative;
  top: -52px;              /* hides owner/title bar */
  height: calc(min(70vh, 680px) + 52px) !important;  /* keep visible map height */
}

@media (max-width: 600px) {
  .lrx-map-embed .lmec-project-map iframe {
    top: -52px;
    height: calc(60vh + 52px) !important;
  }
}

/* Project Map embed: supporting text + link */
.lmec-project-map__intro{
  margin: 0 0 0.75rem 0;
  color: var(--wp--preset--color--ink);
  opacity: 0.9;
  font-size: 0.98rem;
}

.lmec-project-map__meta{
  margin: 0.75rem 0 0 0;
  font-size: 0.95rem;
}

.lmec-project-map__open{
  font-weight: 600;
  text-decoration: none;
}
.lmec-project-map__open:hover{
  text-decoration: underline;
}

/* Keep the “no-name” crop, but soften it a touch so controls don’t feel tight */
.lrx-map-embed .lmec-project-map iframe{
  top: -38px; /* was -44px */
  height: calc(min(70vh, 680px) + 52px) !important;
}
@media (max-width: 600px){
  .lrx-map-embed .lmec-project-map iframe{
    top: -52px;
    height: calc(60vh + 52px) !important;
  }
}

/* ===== Project Map: professional embed card ===== */

.lrx-map-embed .lmec-project-map{
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(0,0,0,0.08);
  overflow: hidden;
}

/* Give the card breathing room inside the wide group */
.lrx-map-embed{
  margin-top: 1.5rem;
  margin-bottom: 2.5rem;
}

/* Caption / helper text */
.lmec-project-map__intro{
  margin: 0;
  padding: 14px 18px 10px 18px;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--wp--preset--color--ink);
  opacity: 0.85;
  border-bottom: 1px solid var(--wp--preset--color--border);
  background: rgba(0,0,0,0.015);
}

/* Frame wraps the iframe; keep it clean */
.lmec-project-map__frame{
  position: relative;
  overflow: hidden;
  background: #fff;
}

/* Map iframe sizing */
.lmec-project-map__frame iframe{
  width: 100% !important;
  height: min(70vh, 680px) !important;
  display: block;
  border: 0 !important;
}

/* Crop top (hide owner line) — tune here */
.lrx-map-embed @media (max-width: 600px){
  .lmec-project-map__frame iframe{
    height: 60vh !important;
  }
  .lrx-map-embed }

/* Footer row with the “open full map” action */
.lmec-project-map__meta{
  margin: 0;
  padding: 12px 18px 14px 18px;
  border-top: 1px solid var(--wp--preset--color--border);
  display: flex;
  justify-content: flex-end;
  background: rgba(0,0,0,0.012);
}

.lmec-project-map__open{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--wp--preset--color--border);
  background: #fff;
  color: var(--wp--preset--color--accent);
}

.lmec-project-map__open:hover{
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(0,0,0,0.10);
  transform: translateY(-1px);
}


/* ===== Project Map embed v2 (crisp + consistent proportions) ===== */

/* Make the wrapper go full width but keep comfortable page padding */
.lrx-map-embed.alignfull{
  padding-left: clamp(16px, 4vw, 44px);
  padding-right: clamp(16px, 4vw, 44px);
}

/* Card already looks good; keep it */
.lrx-map-embed .lmec-project-map{
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(0,0,0,0.08);
  overflow: hidden;
}

/* Caption bar */
.lmec-project-map__intro{
  margin: 0;
  padding: 14px 18px 10px 18px;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--wp--preset--color--ink);
  opacity: 0.85;
  border-bottom: 1px solid var(--wp--preset--color--border);
  background: rgba(0,0,0,0.015);
}

/* The key change: aspect-ratio frame prevents blur/weird stretching */
.lmec-project-map__frame{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #fff;
  overflow: hidden;
}

/* Crop amount (hides owner/name bar) */
:root{ --lrx-map-crop: 64px; }  /* increase/decrease this to tune */

/* Mobile: slightly taller ratio */
@media (max-width: 700px){
  .lmec-project-map__frame{ aspect-ratio: 4 / 5; }
}

/* Footer row */
.lmec-project-map__meta{
  margin: 0;
  padding: 12px 18px 14px 18px;
  border-top: 1px solid var(--wp--preset--color--border);
  display: flex;
  justify-content: flex-end;
  background: rgba(0,0,0,0.012);
}

.lmec-project-map__open{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--wp--preset--color--border);
  background: #fff;
  color: var(--wp--preset--color--accent);
}

.lmec-project-map__open:hover{
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(0,0,0,0.10);
  transform: translateY(-1px);
}

/* ===== Project Map title polish (only on this page) ===== */
body.page-id-7 .wp-block-post-title{
  letter-spacing: -0.02em;
  font-size: clamp(2.2rem, 3.6vw, 3.2rem);
}


/* ===== Map header hide (mask overlay, avoids iframe shifting blur) ===== */
:root{ --lrx-map-mask: 64px; }

.lmec-project-map__frame{
  position: relative;
}

.lmec-project-map__frame iframe{
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  display: block;
}

/* Mask bar that hides the top header area inside the iframe */
.lmec-project-map__frame::before{
  content:"";
  position:absolute;
  top:0; left:0; right:0;
  height: var(--lrx-map-mask);
  background: #fff;          /* match card background */
  z-index: 5;
  pointer-events: none;
}

/* ===== Project Map crispness override: fixed pixel frame ===== */
/* Avoid fractional scaling from aspect-ratio/vh sizing */
.lmec-project-map__frame{
  aspect-ratio: auto !important;
  height: 660px !important;          /* integer px = crisper tiles */
}

/* Mobile */
@media (max-width: 700px){
  .lmec-project-map__frame{ height: 520px !important; }
}

/* Ensure iframe fills the frame normally */
.lmec-project-map__frame iframe{
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

/* Keep the name-hidden mask */
:root{ --lrx-map-mask: 68px; }       /* tune if needed */
.lmec-project-map__frame::before{ height: var(--lrx-map-mask) !important; }


/* Bigger Project Map frame (crisper at 1:1 px) */
.lmec-project-map__frame{
  height: 780px !important;
}

@media (max-width: 900px){
  .lmec-project-map__frame{ height: 620px !important; }
}

@media (max-width: 600px){
  .lmec-project-map__frame{ height: 520px !important; }
}


/* Project Map caption + CTA: cleaner UI font */
.lmec-project-map__intro,
.lmec-project-map__open{
  font-family: var(--wp--preset--font-family--system, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji");
}

/* Caption polish */
.lmec-project-map__intro{
  font-weight: 500;
  letter-spacing: 0.01em;
  font-size: 0.98rem;
  line-height: 1.4;
}

/* Button text polish */
.lmec-project-map__open{
  font-weight: 600;
  letter-spacing: 0.01em;
}


/* Bigger, responsive caption text */
.lmec-project-map__intro{
  font-size: clamp(1.02rem, 1.1vw, 1.15rem);
  line-height: 1.45;
}


/* ============================================================================
   HERO BANNER IMAGE (lrx-banner.png)
   ============================================================================ */

/* Outer wrapper: full-width, no background, no fixed height */
.lrx-hero-banner-wrap {
  width: 100%;
  background: transparent !important;
  line-height: 0; /* collapse whitespace around the img */
}

/* Remove WP figure default margins and any WP alignment padding */
.lrx-hero-banner-img {
  margin: 0 !important;
}

/* The banner image itself — natural width:100%, height auto, no cropping */
.lrx-hero-banner-img img {
  display: block;
  width: 100%;
  height: auto;
}

/* Text block directly below the banner image */
.lrx-hero-text-block {
  padding-top: 40px;
  padding-bottom: 48px;
}

/* ============================================================================
   DYNAMIC UPDATES CARDS — homepage teaser + Staff Updates listing
   ============================================================================ */

/* Homepage grid: 3 equal columns, collapses gracefully */
.lrx-updates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  width: 100%;
}

@media (max-width: 900px) {
  .lrx-updates-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .lrx-updates-grid {
    grid-template-columns: 1fr;
  }
}

/* Card shell */
.lrx-update-card {
  background: #fff;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.lrx-update-card:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.09);
  transform: translateY(-2px);
}

/* Featured image block */
.lrx-update-card__image-link {
  display: block;
  min-height: unset !important;
  padding: 0 !important;
}

.lrx-update-card__image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--wp--preset--color--mist);
}

.lrx-update-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.lrx-update-card:hover .lrx-update-card__image img {
  transform: scale(1.03);
}

/* Card body */
.lrx-update-card__body {
  padding: 1.375rem 1.5rem 1.375rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.lrx-update-card__date {
  font-size: 0.8rem;
  color: var(--wp--preset--color--muted);
  margin: 0 0 0.5rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.lrx-update-card__title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 0.625rem;
  line-height: 1.35;
}

.lrx-update-card__title a {
  color: var(--wp--preset--color--ink);
  text-decoration: none;
  transition: color 0.15s ease;
  display: inline;
  min-height: unset !important;
  padding: 0 !important;
}

.lrx-update-card__title a:hover {
  color: var(--wp--preset--color--accent);
}

.lrx-update-card__excerpt {
  font-size: 0.9375rem;
  color: var(--wp--preset--color--slate);
  line-height: 1.6;
  margin: 0 0 1rem;
  flex: 1;
}

.lrx-update-card__more {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--wp--preset--color--accent);
  text-decoration: none;
  margin-top: auto;
  display: inline;
  min-height: unset !important;
  padding: 0 !important;
  transition: color 0.15s ease;
}

.lrx-update-card__more:hover {
  text-decoration: underline;
}

/* Empty state */
.lrx-updates-empty {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--wp--preset--color--slate);
  border: 1px dashed var(--wp--preset--color--border);
  border-radius: 12px;
  background: var(--wp--preset--color--mist);
}

/* ============================================================================
   STAFF UPDATES LISTING PAGE — row layout
   ============================================================================ */

.lrx-updates-list-full {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.lrx-update-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  background: #fff;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 12px;
  overflow: hidden;
  align-items: start;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s ease;
}

.lrx-update-row:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.lrx-update-row__image-link {
  display: block;
  min-height: unset !important;
  padding: 0 !important;
  align-self: stretch;
}

.lrx-update-row__image {
  width: 200px;
  min-height: 140px;
  height: 100%;
  overflow: hidden;
  background: var(--wp--preset--color--mist);
  flex-shrink: 0;
}

.lrx-update-row__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* When no image, start the body at column 1 */
.lrx-update-row:not(:has(.lrx-update-row__image-link)) {
  grid-template-columns: 1fr;
}

.lrx-update-row__body {
  padding: 1.375rem 1.5rem 1.375rem 0;
}

/* If no image, add left padding too */
.lrx-update-row:not(:has(.lrx-update-row__image-link)) .lrx-update-row__body {
  padding-left: 1.5rem;
}

.lrx-update-row__date {
  font-size: 0.8rem;
  color: var(--wp--preset--color--muted);
  margin: 0 0 0.375rem;
  font-weight: 500;
}

.lrx-update-row__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.lrx-update-row__title a {
  color: var(--wp--preset--color--ink);
  text-decoration: none;
  display: inline;
  min-height: unset !important;
  transition: color 0.15s ease;
}

.lrx-update-row__title a:hover {
  color: var(--wp--preset--color--accent);
}

.lrx-update-row__excerpt {
  font-size: 0.9375rem;
  color: var(--wp--preset--color--slate);
  line-height: 1.6;
  margin: 0 0 0.875rem;
}

.lrx-update-row__more {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--wp--preset--color--accent);
  text-decoration: none;
  display: inline;
  min-height: unset !important;
  padding: 0 !important;
}

.lrx-update-row__more:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  .lrx-update-row {
    grid-template-columns: 1fr;
  }

  .lrx-update-row__image {
    width: 100%;
    height: 180px;
    min-height: unset;
  }

  .lrx-update-row__body {
    padding: 1.125rem 1.25rem 1.25rem;
  }
}

/* ============================================================================
   FINAL QA 2026-09 — CONTACT EMAIL RESPONSIVE WRAPPING
   The public LMEC email is long enough to wrap awkwardly inside narrow
   contact columns (isolating a trailing "m."). Break on the "@" instead
   using an explicit soft break, and permit the whole string to wrap at
   any character as a last resort so no isolated fragment is left dangling.
   ============================================================================ */

.wp-block-columns a[href^="mailto:LMEC.info.2003"],
p a[href^="mailto:LMEC.info.2003"] {
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* Preferred break points: at "@" (wbr). Keep the local-part and the domain
   from splitting internally, which was producing the isolated "m." fragment. */
a.lrx-email-nowrap > span {
  white-space: nowrap;
}

/* ============================================================================
   HAMBURGER HEADER — BRAND LEFT, TOGGLE RIGHT (all widths < 1024px)
   Overrides WordPress core's default 600px overlay threshold and the 900px+
   3-column grid so that below 1024px:
     • the inline nav UL is hidden;
     • the hamburger toggle is shown;
     • the header row is a normal flex row (not row-reverse): brand LEFT,
       hamburger RIGHT.
   This fixes: (A) the ordering reversal at 782–1023px, and (B) the click
   failure caused by the inline nav UL remaining visible and crowding the
   toggle button in the row-reversed layout.
   ============================================================================ */

@media (max-width: 1023.98px) {
  /* Hide the overlay container when the menu is closed */
  .site-header .wp-block-navigation__responsive-container:not(.is-menu-open) {
    display: none !important;
  }

  /* Hide the inline nav UL — hamburger overlay mode only at these widths */
  .site-header .wp-block-navigation > .wp-block-navigation__container {
    display: none !important;
  }

  /* Show the hamburger toggle button */
  .site-header .wp-block-navigation__responsive-container-open {
    display: flex !important;
  }

  /* Header row: brand left, toggle right — override grid and row-reverse */
  .site-header > .wp-block-group {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    grid-template-columns: none !important;
  }

  /* Brand: anchored to the left, natural width */
  .site-header .wp-block-site-title {
    flex: 0 0 auto !important;
    text-align: left !important;
    grid-column: auto !important;
    justify-self: start !important;
    white-space: nowrap;
    margin: 0 !important;
  }

  /* Navigation: anchored to the right, shrinks to hamburger button size */
  .site-header .wp-block-navigation {
    flex: 0 0 auto !important;
    grid-column: auto !important;
    justify-self: end !important;
    margin: 0 !important;
  }

  /* Hamburger toggle button sizing */
  .site-header .wp-block-navigation__responsive-container-open {
    order: 0;
    color: var(--wp--preset--color--ink) !important;
    min-width: 48px;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--lrx-transition-fast);
    position: relative;
    z-index: 1001;
  }

  .site-header .wp-block-navigation__responsive-container-open:hover {
    color: var(--wp--preset--color--accent) !important;
  }

  .site-header .wp-block-navigation__responsive-container-open svg {
    fill: currentColor;
    width: 24px;
    height: 24px;
  }

  /* Overlay panel background */
  .site-header .wp-block-navigation__responsive-container.is-menu-open {
    padding-top: 0;
    background: var(--wp--preset--color--white) !important;
  }

  /* Close button */
  .site-header .wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation__responsive-container-close {
    min-width: 48px;
    min-height: 48px;
    color: var(--wp--preset--color--ink);
    margin: 0.5rem 0.5rem 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--lrx-radius-sm);
    transition: background var(--lrx-transition-fast);
  }
}

