/* LM_Website base styles (keep minimal; avoid overriding legacy inline styles) */

:root {
  /* Colors */
  --color-bg: #ffffff;
  --color-fg: #0b0b0b;
  --color-accent: #0d6efd;

  /* Typography */
  --font-sans: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  --text-base: 16px;

  /* Spacing */
  --space-1: 0.25rem;
  --lm-shadow: 0 6px 20px rgba(0,0,0,0.08);
  --lm-shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;

  /* Breakpoints */
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;
}

/* --- Last Mile design system (lean) --- */
:root {
  --lm-bg: #ffffff;
  --lm-surface: #ffffff;
  --lm-elev: #f7f9fc;
  --lm-text: #222222;
  --lm-text-subtle: #5c6b7a;
  --lm-primary: #1D7CD8;
  --lm-primary-600: #1768b3;
  --lm-accent: #0fb; /* reserved */
  --lm-border: #e6eaf0;
  --lm-radius: 12px;
  --lm-shadow: 0 6px 20px rgba(0,0,0,0.08);
  --lm-container: 1200px;
}

html, body { height: 100%; }
body {
  background: var(--lm-bg);
  color: var(--lm-text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
}

* {
  box-sizing: border-box;
}

img, picture, video {
  max-width: 100%;
  height: auto;
}

/* Base defaults (non-invasive) */
html { font-size: var(--text-base); }
body { color: var(--color-fg); background: var(--color-bg); font-family: var(--font-sans); }

/* Accessibility helpers */
.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: static; width: auto; height: auto; padding: var(--space-2) var(--space-3); background: #fffa; }

/* Utilities */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Typography */
.lm-h1 { font-size: clamp(2rem, 3.5vw, 3rem); line-height: 1.15; margin: 0 0 0.5rem; }
.lm-h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.2; margin: 0 0 0.5rem; }
.lm-h3 { font-size: clamp(1.125rem, 2vw, 1.25rem); margin: 0 0 0.25rem; }
.lm-lead { color: var(--lm-text-subtle); font-size: 1.125rem; }
.lm-text-sm { font-size: .9rem; }
.lm-text-secondary { color: var(--lm-text-subtle); }

/* Layout */
.lm-container { width: min(100% - 2rem, var(--lm-container)); margin-inline: auto; }
.lm-section { padding: 4rem 0; background: var(--lm-surface); }
.lm-section--alt { background: var(--lm-elev); }
.lm-hero { padding: 6rem 0 4rem; background: linear-gradient(180deg, rgba(29,124,216,0.06), rgba(29,124,216,0.02)); }
.lm-hero--inverse { background: #ffffff; }
.lm-cta { padding: 3rem 0; background: var(--lm-elev); text-align: center; }
.lm-cta--inverse { background: #ffffff; }

/* subtle separator */
.lm-divider { height: 1px; background: linear-gradient(90deg, rgba(15,23,42,0.0), rgba(15,23,42,0.12), rgba(15,23,42,0.0)); border: 0; margin: 0; }

/* Grid */
.lm-grid { display: grid; gap: 2rem; }
.lm-grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.lm-grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 900px) { .lm-grid--2, .lm-grid--3 { grid-template-columns: 1fr; } }
.lm-grid--flip > :first-child { order: 2; }

/* Buttons & links */
.lm-btn { display:inline-block; padding: .75rem 1.1rem; border-radius: var(--lm-radius); text-decoration: none; color: #fff; box-shadow: var(--lm-shadow); }
.lm-btn--primary { background: var(--lm-primary); }
.lm-btn--primary:hover { background: var(--lm-primary-600); }
.lm-link { color: var(--lm-primary); text-decoration: none; }
.lm-link:hover { text-decoration: underline; }

/* Surfaces */
.lm-card { background: #fff; border: 1px solid var(--lm-border); border-radius: var(--lm-radius); padding: 1rem 1.1rem; box-shadow: var(--lm-shadow); }
.lm-media-placeholder { background: #f3f6fa; border: 1px dashed var(--lm-border); border-radius: var(--lm-radius); height: 220px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.02); }

/* Forms */
.lm-form { display: grid; gap: 1rem; max-width: 560px; }
.lm-label { display: grid; gap: .35rem; color: var(--lm-text-subtle); }
.lm-input, .lm-textarea { background: #ffffff; color: var(--lm-text); border: 1px solid var(--lm-border); border-radius: 10px; padding: .65rem .8rem; box-shadow: var(--lm-shadow-soft); }
.lm-input:focus, .lm-textarea:focus { outline: none; border-color: var(--lm-primary); box-shadow: 0 0 0 3px rgba(77,163,255,0.2); }
.site-footer, .site-header, .lm-card, .lm-input, .lm-textarea, .button, .lm-btn { box-shadow: var(--lm-shadow-soft); }
.lm-checkbox { display:flex; gap:.5rem; align-items:center; color: var(--lm-text-subtle); }

/* Header basics (minimal polish) */
.site-header { background: #ffffff; position: sticky; top: 0; border-bottom: 1px solid var(--lm-border); z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; }
.nav-left { list-style: none; display: flex; gap: 1rem; margin: 0; padding: 0; }
.nav-left a { color: #111; text-decoration: none; padding: .4rem .6rem; border-radius: 6px; }
.nav-left a:hover { background: #f2f6fb; color: #000; }
.brand-right { display: inline-flex; align-items: center; }
.brand-logo { height: 28px; width: auto; }
.brand-title { margin-left: .6rem; font-weight: 400; color: #111; letter-spacing: .2px; font-size: 1.25rem; }
@media (min-width: 768px) { .brand-title { font-size: 1.4rem; } }

/* Footer (polished, light) */
.site-footer { background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%); border-top: 1px solid var(--lm-border); color: var(--lm-text-subtle); }
.site-footer .lm-container { padding: 1rem 1rem; }
.site-footer .footer-top { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 0; min-height: 0; }
.site-footer .brand { display: inline-flex; align-items: center; gap: .6rem; }
.site-footer .brand-logo { height: 28px; width: auto; }
.site-footer .brand-title { margin-left: .0rem; font-weight: 400; color: #111; letter-spacing: .2px; font-size: 1.25rem; }
@media (min-width: 768px) { .site-footer .brand-title { font-size: 1.4rem; } }
.site-footer .footer-nav { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 1.25rem 2rem; }
.site-footer .footer-nav { align-self: center; }
.site-footer .footer-heading { font-weight: 600; color: #0f172a; font-size: .95rem; margin-bottom: .5rem; }
.site-footer .footer-heading { margin-top: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.site-footer a { color: #334155; text-decoration: none; }
.site-footer a:hover { color: #111; text-decoration: underline; }
.site-footer .footer-bottom { display:flex; align-items:center; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--lm-border); padding-top: 1rem; font-size: .9rem; }
.site-footer .legal { color: #64748b; }
@media (max-width: 800px){
  .site-footer .footer-top { flex-direction: column; }
  .site-footer .footer-nav { grid-template-columns: 1fr 1fr; }
}

/* Place new components below with clear section comments. */

/* --- Hero carousel (landing) --- */
.inverse-section { position: relative; /* default gentle downward nudge for vertical centering */ --hero-v-offset: 2vh; }
.hero-carousel { position: absolute; left: 4vw; top: calc(50% + var(--hero-v-offset, 0px)); transform: translateY(-50%); width: calc(var(--hero-split-left, 50vw) - 8vw); max-width: none; z-index: 2; display: flex; align-items: center; }
.hero-slide { display: none; max-width: 100%; }
.hero-slide.is-active { display: block; }
.hero-carousel .h1-heading { color: #fff; margin: 0; line-height: 1.06; font-size: clamp(3rem, 6.5vw, 4rem); text-shadow: 0 2px 18px rgba(0,0,0,0.45); }
.hero-carousel .hero-sub { display: none; }

/* Carousel height adjustment - reduce by 40% */
.inverse-section .utility-min-height-100dvh {
  min-height: 60vh !important; /* 40% reduction from 100vh */
  max-height: none;
}

/* Fix footer overlap - disable sticky positioning on card section */
.inverse-section .utility-position-sticky {
  position: relative !important;
}

/* Remove fade effect from right card */
.utility-mask-right {
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

/* Ensure background images maintain aspect ratio without distortion */
.inverse-section .utility-min-height-100dvh .hero-image-container,
.inverse-section .utility-min-height-100dvh .grid-layout.is-absolute-fullscreen {
  min-height: 60vh;
  max-height: 60vh;
  object-fit: cover;
  object-position: center;
}

/* Right-side subheadline panel */
.hero-subpanel { position: absolute; top: calc(50% + var(--hero-v-offset, 0px)); bottom: auto; transform: translateY(-50%); left: var(--hero-split-left, 50vw); right: 0; padding: 0 6vw; max-width: none; min-width: 260px; display:flex; align-items:center; justify-content:center; text-align: center; z-index: 3; }
.hero-subpanel .hero-sub-outlet { color: #fff; opacity: .98; font-size: clamp(1.2rem, 2vw, 1.6rem); line-height: 1.5; margin: 0; text-wrap: balance; text-shadow: 0 1px 12px rgba(0,0,0,0.35); }

/* Responsive fallback: stack under headline on smaller screens */
@media (max-width: 900px) {
  .hero-carousel { position: static; transform: none; left: auto; width: 100%; max-width: 100%; }
  .hero-subpanel { position: static; transform: none; width: 100%; max-width: 64ch; margin-top: .75rem; text-align: left; padding: 0; }
  .hero-subpanel .hero-sub-outlet { opacity: .96; }
}

/* --- About layout --- */
.lm-about { display: flex; align-items: flex-start; gap: 1.5rem; margin-top: .5rem; }
.lm-about-flow { position: relative; }
.lm-about-brand { margin: 0; text-align: center; flex: 0 0 auto; }
.lm-about-brand--float { float: left; margin-right: 1.25rem; }
.lm-about-brand img { display: block; width: 90px; height: auto; }
.lm-about-brand figcaption { margin-top: .5rem; font-weight: 700; color: #0f172a; letter-spacing: .3px; font-size: 1.25rem; }
.lm-about-images { position: relative; }
.lm-about-images--float { float: right; margin-left: 0.75rem; }
.lm-photo { position: relative; display: block; width: 320px; border-radius: 10px; overflow: hidden; box-shadow: var(--lm-shadow); border: 1px solid var(--lm-border); background: #fff; }
.lm-photo img { display: block; width: 100%; height: auto; }
.lm-photo--one { z-index: 1; transform: none; }
.lm-photo--two { z-index: 2; margin-top: 16px; margin-left: 20px; transform: none; }
.lm-about-content { flex: 1 1 auto; }
.lm-about-content p:first-child { margin-top: 0; }
.clearfix { clear: both; }
@media (max-width: 680px) {
  .lm-about { gap: 1rem; }
  .lm-about-brand--float, .lm-about-images--float { float: none; margin: 0 0 1rem 0; }
  .lm-photo { width: 100%; max-width: 360px; }
  .lm-photo--two { margin-left: 0; }
  .lm-about-brand img { width: 70px; }
}

/* Nudge logo/caption slightly right under the About Us heading on wider screens */
@media (min-width: 700px) { .lm-about-brand { margin-left: 0.75rem; } }
@media (min-width: 1024px) { .lm-about-brand { margin-left: 1rem; } }

/* --- Careers page --- */
.lm-careers-intro { margin-bottom: 0; }
.lm-careers-intro .lm-h2 { color: var(--lm-primary); }
.lm-section:has(.lm-careers-intro) { padding-bottom: 2rem; }
.lm-section:has(.lm-careers-intro) + .lm-section { padding-top: 2rem; }
.lm-section:has(.lm-careers-intro) + .lm-section .lm-h2 { color: var(--lm-primary); }
.lm-positions { display: grid; gap: 1.5rem; }
.lm-position { background: #fff; border: 1px solid var(--lm-border); border-radius: var(--lm-radius); padding: 1.5rem; box-shadow: var(--lm-shadow); transition: box-shadow 0.2s ease; }
.lm-position:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.lm-position-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; gap: 1rem; position: relative; }
.lm-position-header .lm-h3 { font-size: 1.5rem; font-weight: 700; margin: 0 0 0.5rem 0; }
.lm-position-toggle { position: absolute; right: 0; top: 0; font-size: 1.5rem; line-height: 1; color: var(--lm-primary); background: none; border: none; cursor: pointer; padding: 0.5rem; width: 2.5rem; height: 2.5rem; display: flex; align-items: center; justify-content: center; transition: transform 0.2s ease; }
.lm-position-toggle:hover { transform: scale(1.15); }
.lm-position-preview { margin-bottom: 1rem; color: var(--lm-text); line-height: 1.6; }
.lm-position-content { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out; }
.lm-position--expanded .lm-position-preview { display: none; }
.lm-position--expanded .lm-position-content { max-height: 10000px; opacity: 1; }
.lm-position-content p { margin-bottom: 1rem; }
.lm-position-content p:last-child { margin-bottom: 0; }
.lm-position-meta { display: flex; gap: 0.5rem; }
.lm-badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 6px; font-size: 0.875rem; font-weight: 500; background: var(--lm-primary); color: white; }
.lm-badge--secondary { background: var(--lm-text-subtle); }
.lm-position-footer { margin-top: 1.5rem; }
.lm-position-footer p { margin-bottom: 0.5rem; }
.lm-position-footer p:last-child { margin-bottom: 0; }
.lm-careers-cta { text-align: center; max-width: 600px; margin: 0 auto; }
.lm-cta-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.lm-button { display: inline-block; padding: 0.75rem 1.5rem; border-radius: var(--lm-radius); text-decoration: none; font-weight: 500; transition: background 0.2s ease; }
.lm-button--primary { background: var(--lm-primary); color: white; }
.lm-button--primary:hover { background: var(--lm-primary-600); }
.lm-button--secondary { background: transparent; color: var(--lm-primary); border: 1px solid var(--lm-primary); }
.lm-button--secondary:hover { background: var(--lm-primary); color: white; }

@media (max-width: 768px) {
  .lm-position-header { flex-direction: column; align-items: flex-start; padding-right: 2rem; }
  .lm-position-meta { align-self: flex-start; }
  .lm-position-toggle { top: 0.5rem; }
  .lm-cta-actions { flex-direction: column; align-items: center; }
}

/* Lists */
.lm-list-unstyled { list-style: none; margin: 0; padding: 0; }
.lm-resource-list { display: grid; gap: 1.5rem; }
.lm-resource-list article { background: #fff; border: 1px solid var(--lm-border); border-radius: var(--lm-radius); padding: 1.5rem; box-shadow: var(--lm-shadow); }

/* Page intro section */
.lm-page-intro { background: linear-gradient(180deg, rgba(29,124,216,0.06), rgba(29,124,216,0.02)); padding: 4rem 0 1rem; }
.lm-page-intro .lm-h1 { margin-bottom: 0.75rem; }
.lm-page-intro .lm-lead { max-width: 100%; }
.lm-page-intro + .lm-section { padding-top: 2rem; }
.lm-section + .lm-section--alt { padding-top: 2rem; }

/* --- Home page card fixes --- */
/* Fix: Make cards equal height in the flex-horizontal container */
.flex-horizontal {
  align-items: stretch;
}

.flex-horizontal .ix-card-change-width,
.flex-horizontal .utility-width-33 {
  display: flex;
  flex-direction: column;
}

.flex-horizontal .ix-card-change-width .lm-layout-grid,
.flex-horizontal .utility-width-33 .grid-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.flex-horizontal .card.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Fix: Remove forced full viewport height from card section only (not carousel) */
.ix-card-change-width-trigger .utility-min-height-100dvh {
  min-height: auto !important;
}

/* Fix: Reduce footer spacing - change 50vh to a reasonable spacing */
.utility-viewport-height-50 {
  height: 0.5in !important; /* Half inch as requested */
  max-height: 36px; /* Fallback for browsers that don't support inches */
}

/* Fix: Adjust gradient on card text boxes to be fully transparent by 90% */
/* Apply mask to the container so it affects card, shadow, border, everything */
.utility-mask-right {
  -webkit-mask-image: linear-gradient(to right, #000 20%, #000 70%, transparent 90%) !important;
  mask-image: linear-gradient(to right, #000 20%, #000 70%, transparent 90%) !important;
}

.utility-mask-right * {
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

/* Fix: Remove drop shadow from card on carousel - most aggressive override */
.grid-layout.desktop-1-column.grid-gap-xs .card.card-body.utility-backdrop-filter-blur.card-on-inverse,
.grid-layout .card.card-body.utility-backdrop-filter-blur.card-on-inverse,
div.card.card-body.utility-backdrop-filter-blur.card-on-inverse,
.card.card-body.utility-backdrop-filter-blur.card-on-inverse,
.card.card-body,
.card-body.card-on-inverse,
[class*="card"][class*="backdrop-filter"] {
  box-shadow: none !important;
  filter: none !important;
}
