/* ==========================================================================
   LJMD WordPress Baseline CSS
   For WordPress + Elementor Pro builds (Hello Elementor or any light theme)
   Load order: after theme styles, before site-specific overrides.

   CHANGELOG (newest first, one dated line per change)
   2026-09-30  v1.1  Custom Elementor breakpoints (767/880/1024/1200/1366/2400)
   2026-09-30  v1.0  Initial baseline
   ========================================================================== */


/* --------------------------------------------------------------------------
   0. Breakpoint reference (Elementor custom breakpoints)
   CSS variables can't be used inside media queries, so these are hardcoded.
   Mobile Portrait     0    to 767
   Mobile Landscape    768  to 880
   Tablet Portrait     881  to 1024
   Tablet Landscape    1025 to 1200
   Laptop              1201 to 1366
   Desktop (default)   1367 to 2399
   Widescreen          2400 and up
   -------------------------------------------------------------------------- */


/* --------------------------------------------------------------------------
   1. Design tokens
   Swap these per client. Elementor Global Colours/Fonts can map to them
   via custom CSS or by matching the values.
   -------------------------------------------------------------------------- */
:root {
  /* Colour */
  --c-primary: #0f4c81;
  --c-primary-dark: #0a3558;
  --c-secondary: #f2a900;
  --c-text: #1f2328;
  --c-text-muted: #5b6470;
  --c-heading: #111418;
  --c-bg: #ffffff;
  --c-bg-alt: #f5f6f8;
  --c-border: #dde1e6;
  --c-success: #1e7f4f;
  --c-error: #c62828;
  --c-focus: #2563eb;

  /* Typography */
  --ff-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ff-heading: var(--ff-body);
  --ff-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-base: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --fs-sm: 0.875rem;
  --fs-h1: clamp(2.25rem, 1.8rem + 2.2vw, 3.5rem);
  --fs-h2: clamp(1.875rem, 1.55rem + 1.5vw, 2.75rem);
  --fs-h3: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --fs-h4: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --fs-h5: 1.125rem;
  --fs-h6: 1rem;

  --lh-body: 1.65;
  --lh-heading: 1.2;
  --fw-body: 400;
  --fw-heading: 700;

  /* Spacing */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: clamp(3rem, 2rem + 4vw, 6rem);

  /* Layout */
  --container: 1240px;
  --container-narrow: 760px;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2rem);

  /* UI */
  --radius: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.12);
  --transition: 0.2s ease;
}


/* --------------------------------------------------------------------------
   2. Modern reset (light touch, safe alongside Elementor)
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 100px; /* offset for sticky headers on anchor links */
}

body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  color: var(--c-text);
  background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Keep inline icons inline (Elementor icons, emoji, inline SVG in text) */
p img,
li img,
.elementor-icon svg,
.e-font-icon-svg {
  display: inline-block;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

p,
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

iframe {
  max-width: 100%;
  border: 0;
}


/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-md);
  font-family: var(--ff-heading);
  font-weight: var(--fw-heading);
  line-height: var(--lh-heading);
  color: var(--c-heading);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-h5); }
h6 { font-size: var(--fs-h6); }

p {
  margin: 0 0 var(--space-md);
  text-wrap: pretty;
}

ul,
ol {
  margin: 0 0 var(--space-md);
  padding-left: 1.4em;
}

li + li {
  margin-top: var(--space-2xs);
}

a {
  color: var(--c-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--transition);
}

a:hover {
  color: var(--c-primary-dark);
}

strong,
b {
  font-weight: 700;
}

small {
  font-size: var(--fs-sm);
}

blockquote {
  margin: var(--space-lg) 0;
  padding: var(--space-sm) var(--space-lg);
  border-left: 4px solid var(--c-primary);
  background: var(--c-bg-alt);
  font-size: 1.1em;
}

blockquote p:last-child {
  margin-bottom: 0;
}

hr {
  height: 1px;
  margin: var(--space-xl) 0;
  border: 0;
  background: var(--c-border);
}

code,
kbd,
pre {
  font-family: var(--ff-mono);
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  padding: var(--space-md);
  border-radius: var(--radius);
  background: var(--c-bg-alt);
}

/* Remove trailing margin inside content blocks */
.elementor-widget-text-editor > *:last-child,
.elementor-widget-text-editor p:last-child,
.entry-content > *:last-child {
  margin-bottom: 0;
}


/* --------------------------------------------------------------------------
   4. Tables
   -------------------------------------------------------------------------- */
table {
  width: 100%;
  margin: 0 0 var(--space-lg);
  border-collapse: collapse;
  font-size: 0.95em;
}

th,
td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--c-border);
  text-align: left;
  vertical-align: top;
}

th {
  font-weight: 700;
  color: var(--c-heading);
  background: var(--c-bg-alt);
}

/* Wrap wide tables for mobile scroll */
.table-scroll,
.wp-block-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}


/* --------------------------------------------------------------------------
   5. Buttons
   Applies to generic buttons and core block buttons. Elementor Button
   widgets keep their own widget styling unless you add .btn.
   -------------------------------------------------------------------------- */
.btn,
button:not(.elementor-button):not([class*="elementor-"]):not(.menu-toggle),
input[type="submit"],
input[type="button"],
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.8em 1.6em;
  border: 2px solid var(--c-primary);
  border-radius: var(--radius);
  background: var(--c-primary);
  color: #fff;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.btn:hover,
button:not(.elementor-button):not([class*="elementor-"]):not(.menu-toggle):hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.wp-block-button__link:hover {
  border-color: var(--c-primary-dark);
  background: var(--c-primary-dark);
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--c-primary);
}

.btn--outline:hover {
  background: var(--c-primary);
  color: #fff;
}

.btn--secondary {
  border-color: var(--c-secondary);
  background: var(--c-secondary);
  color: var(--c-heading);
}

button:disabled,
input[type="submit"]:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}


/* --------------------------------------------------------------------------
   6. Forms (native, Elementor Forms, Gravity Forms, CF7, WPForms)
   -------------------------------------------------------------------------- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 48px; /* comfortable tap target */
  padding: 0.7em 0.9em;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background-color: #fff;
  line-height: 1.4;
  transition: border-color var(--transition), box-shadow var(--transition);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 20%, transparent);
}

::placeholder {
  color: var(--c-text-muted);
  opacity: 1;
}

label {
  display: inline-block;
  margin-bottom: var(--space-2xs);
  font-weight: 600;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.1em;
  height: 1.1em;
  accent-color: var(--c-primary);
}

/* iOS zooms on inputs under 16px (covers mobile portrait + landscape) */
@media (max-width: 880px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Validation messages */
.elementor-message-danger,
.wpcf7-not-valid-tip,
.gfield_validation_message,
.wpforms-error {
  color: var(--c-error);
  font-size: var(--fs-sm);
}

.elementor-message-success,
.wpcf7-mail-sent-ok,
.gform_confirmation_message {
  color: var(--c-success);
}


/* --------------------------------------------------------------------------
   7. Accessibility
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

.screen-reader-text,
.sr-only,
.elementor-screen-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  z-index: 100000;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  padding: 12px 20px;
  clip: auto;
  background: #fff;
  color: var(--c-heading);
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 100000;
  padding: 12px 20px;
  background: var(--c-heading);
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
}

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

  html {
    scroll-behavior: auto;
  }
}


/* --------------------------------------------------------------------------
   8. WordPress core classes
   -------------------------------------------------------------------------- */
.alignleft {
  float: left;
  margin: 0.3em var(--space-lg) var(--space-md) 0;
}

.alignright {
  float: right;
  margin: 0.3em 0 var(--space-md) var(--space-lg);
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 767px) {
  .alignleft,
  .alignright {
    float: none;
    margin: 0 auto var(--space-md);
  }
}

.alignwide {
  width: min(100vw - (var(--gutter) * 2), var(--container));
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.alignfull {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
}

.wp-caption,
figure {
  max-width: 100%;
  margin: 0 0 var(--space-lg);
}

.wp-caption-text,
figcaption,
.wp-element-caption {
  margin-top: var(--space-xs);
  color: var(--c-text-muted);
  font-size: var(--fs-sm);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-md);
}

.sticky,
.bypostauthor {
  /* required by theme check, intentionally empty */
}

/* Responsive embeds (YouTube, Vimeo) */
.wp-block-embed__wrapper,
.embed-responsive {
  position: relative;
  aspect-ratio: 16 / 9;
}

.wp-block-embed__wrapper iframe,
.embed-responsive iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}


/* --------------------------------------------------------------------------
   9. Elementor tidy-ups
   -------------------------------------------------------------------------- */

/* Stop Elementor containers causing horizontal scroll */
.elementor-section-stretched,
.e-con-full {
  overflow-x: clip;
}

/* Consistent image corners when .rounded is added in Advanced > CSS Classes */
.rounded img,
.rounded {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Prevent widget headings inheriting unwanted margins */
.elementor-heading-title {
  margin: 0;
}

/* Icon list: tidy spacing */
.elementor-icon-list-items li + li {
  margin-top: 0;
}

/* Hide empty Elementor text widgets (e.g. empty ACF dynamic fields) */
.elementor-widget-text-editor:has(.elementor-widget-container:empty),
.elementor-widget-heading:has(.elementor-heading-title:empty) {
  display: none;
}

/* Sticky header shadow when Elementor adds .elementor-sticky--effects */
.elementor-sticky--effects {
  box-shadow: var(--shadow-sm);
}


/* --------------------------------------------------------------------------
   10. Layout helpers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: var(--space-2xl);
}

.bg-alt {
  background-color: var(--c-bg-alt);
}

.grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

.flow > * + * {
  margin-top: var(--space-md);
}


/* --------------------------------------------------------------------------
   11. Utilities
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }
.text-muted  { color: var(--c-text-muted); }
.text-primary { color: var(--c-primary); }
.text-balance { text-wrap: balance; }

.fw-400 { font-weight: 400; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.uppercase {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-sm { margin-bottom: var(--space-sm) !important; }
.mb-md { margin-bottom: var(--space-md) !important; }
.mb-lg { margin-bottom: var(--space-lg) !important; }

.shadow    { box-shadow: var(--shadow-sm); }
.shadow-lg { box-shadow: var(--shadow-md); }

.hover-lift {
  transition: transform var(--transition), box-shadow var(--transition);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* Responsive visibility: single breakpoint only */
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 768px) and (max-width: 880px) {
  .hide-mobile-landscape { display: none !important; }
}

@media (min-width: 881px) and (max-width: 1024px) {
  .hide-tablet { display: none !important; }
}

@media (min-width: 1025px) and (max-width: 1200px) {
  .hide-tablet-landscape { display: none !important; }
}

@media (min-width: 1201px) and (max-width: 1366px) {
  .hide-laptop { display: none !important; }
}

@media (min-width: 1367px) and (max-width: 2399px) {
  .hide-desktop { display: none !important; }
}

@media (min-width: 2400px) {
  .hide-widescreen { display: none !important; }
}

/* Responsive visibility: ranges (hide at and below / at and above) */
@media (max-width: 880px) {
  .hide-mobile-all { display: none !important; }      /* all phones */
}

@media (max-width: 1200px) {
  .hide-tablet-down { display: none !important; }     /* phones + tablets */
}

@media (min-width: 881px) {
  .hide-tablet-up { display: none !important; }       /* tablet portrait and larger */
}

@media (min-width: 1201px) {
  .hide-laptop-up { display: none !important; }       /* laptop and larger */
}


/* --------------------------------------------------------------------------
   11b. Breakpoint adjustments
   -------------------------------------------------------------------------- */

/* Laptop: slightly tighter container */
@media (min-width: 1201px) and (max-width: 1366px) {
  :root {
    --container: 1140px;
  }
}

/* Tablet landscape and below: reduce section padding */
@media (max-width: 1200px) {
  :root {
    --space-2xl: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
  }
}

/* Mobile portrait: single-column grid and full-width buttons in forms */
@media (max-width: 767px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .elementor-form .elementor-button,
  .gform_button,
  .wpcf7-submit {
    width: 100%;
  }
}

/* Widescreen: scale up so layouts don't look tiny on 2400px+ displays */
@media (min-width: 2400px) {
  :root {
    --container: 1680px;
    --container-narrow: 960px;
  }

  html {
    font-size: 125%;
  }
}


/* --------------------------------------------------------------------------
   12. Print
   -------------------------------------------------------------------------- */
@media print {
  header,
  footer,
  nav,
  .elementor-location-header,
  .elementor-location-footer,
  .skip-link {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
    font-size: 12pt;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}
