/*
 Theme Name:   DRC Military
 Theme URI:    https://drcmilitary.com
 Description:  Child theme of Hello Elementor for DRC Military
 Author:       DRC Military
 Template:     hello-elementor
 Version:      2.6.6
 Text Domain:  drc-military
*/

/* ============================================
   DRC MILITARY — PREMIUM DESIGN SYSTEM v3.2
   Patriotic red/white/blue + camo + bold military.
   ============================================ */

:root {
  --drc-red: #CC0000;
  --drc-red-dark: #990000;
  --drc-navy: #0A1628;
  --drc-navy-mid: #1B3A5C;
  --drc-blue: #1E4D8C;
  --drc-black: #0A0A0A;
  --drc-dark: #111111;
  --drc-dark-card: #1A1A1A;
  --drc-gray: #333333;
  --drc-light-gray: #F5F5F5;
  --drc-white: #FFFFFF;
  --drc-gold: #C4A265;
  --drc-font-heading: 'Oswald', sans-serif;
  --drc-font-body: 'Roboto', 'Open Sans', sans-serif;
}

/* --- Base --- */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
html { scroll-behavior: smooth; }
::selection { background: var(--drc-red); color: var(--drc-white); }

/* ============================================
   SCROLL ANIMATIONS (load-only, no hover)
   ============================================ */
@keyframes drc-fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Fade-in all widgets EXCEPT counters (their JS animation conflicts) */
.e-con.e-parent > .e-con-inner > .elementor-widget:not(.elementor-widget-counter),
.e-con.e-parent > .elementor-widget:not(.elementor-widget-counter) {
  opacity: 0;
  animation: drc-fadeInUp 0.6s ease forwards;
}
.e-con.e-parent > .e-con-inner > .elementor-widget:nth-child(1),
.e-con.e-parent > .elementor-widget:nth-child(1) { animation-delay: 0.1s; }
.e-con.e-parent > .e-con-inner > .elementor-widget:nth-child(2),
.e-con.e-parent > .elementor-widget:nth-child(2) { animation-delay: 0.15s; }
.e-con.e-parent > .e-con-inner > .elementor-widget:nth-child(3),
.e-con.e-parent > .elementor-widget:nth-child(3) { animation-delay: 0.2s; }
.e-con.e-parent > .e-con-inner > .elementor-widget:nth-child(4),
.e-con.e-parent > .elementor-widget:nth-child(4) { animation-delay: 0.25s; }

/* ============================================
   HEADER
   ============================================ */
.elementor-location-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}
/* Nav links — white, all caps, controlled underline */
.elementor-location-header .elementor-nav-menu a,
.elementor-location-header .elementor-nav-menu .elementor-item {
  color: #FFFFFF !important;
  text-transform: uppercase !important;
  letter-spacing: 1.5px;
}
/* Override Elementor's pointer underline color */
.elementor-location-header .elementor-nav-menu--main .elementor-item::before,
.elementor-location-header .elementor-nav-menu--main .elementor-item::after {
  background-color: var(--drc-red) !important;
}
/* Current/active page — red text */
.elementor-location-header .elementor-nav-menu .current-menu-item a,
.elementor-location-header .elementor-nav-menu .elementor-item-active {
  color: var(--drc-red) !important;
}
/* Hover — red text */
.elementor-location-header .elementor-nav-menu a:hover,
.elementor-location-header .elementor-nav-menu .elementor-item:hover {
  color: var(--drc-red) !important;
}

/* ============================================
   BUTTONS
   ============================================ */
.elementor-button {
  letter-spacing: 2px;
  font-weight: 700 !important;
  text-transform: uppercase;
}

/* ============================================
   ICONS — cog icon gold color site-wide
   ============================================ */
.e-font-icon-svg.e-fas-cog {
  fill: #C4A265 !important;
}

/* ============================================
   IMAGES — drop shadow for vehicle PNGs
   Uses [i] flag for case-insensitive matching so uploads like
   M113-vehicle.png, Bradley-A3.jpg, HMMWV.png all match
   ============================================ */
.elementor-widget-image img[src*="humvee" i],
.elementor-widget-image img[src*="hmmwv" i],
.elementor-widget-image img[src*="bradley" i],
.elementor-widget-image img[src*="m109" i],
.elementor-widget-image img[src*="m113" i],
.elementor-widget-image img[src*="paladin" i] {
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
}

/* ============================================
   COUNTERS
   ============================================ */
.elementor-counter-number-wrapper {
  font-family: var(--drc-font-heading) !important;
}

/* ============================================
   ICON LISTS
   ============================================ */
.drc-approved-list .elementor-icon-list-item,
.drc-testing-list .elementor-icon-list-item {
  padding: 6px 0;
}

/* ============================================
   HEADING ACCENT
   ============================================ */
.drc-heading-accent::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--drc-red);
  margin-top: 15px;
}

/* ============================================
   FOOTER — patriotic red/white/blue top stripe
   ============================================ */
.elementor-location-footer {
  position: relative;
}
.elementor-location-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--drc-red) 0%, var(--drc-red) 33%,
    var(--drc-white) 33%, var(--drc-white) 66%,
    var(--drc-navy-mid) 66%, var(--drc-navy-mid) 100%
  );
}

/* ============================================
   PATRIOTIC ACCENTS
   ============================================ */

/* Red-white-blue divider stripe between major sections */
.elementor-element-cta_bar {
  border-top: 4px solid transparent;
  border-image: linear-gradient(90deg,
    var(--drc-red) 0%, var(--drc-red) 33%,
    var(--drc-white) 33%, var(--drc-white) 66%,
    var(--drc-navy-mid) 66%, var(--drc-navy-mid) 100%
  ) 1;
}

/* Stars graphic as watermark on light sections */
.elementor-element-legacy_section > .e-con-inner::before,
.elementor-element-legacy_section > .elementor-element:first-child::before {
  /* Stars watermark handled by Elementor widget — no CSS pseudo needed */
}

/* Navy blue tint on the header for patriotic feel */
.elementor-location-header {
  background: linear-gradient(180deg, var(--drc-navy) 0%, var(--drc-dark) 100%) !important;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--drc-dark); }
::-webkit-scrollbar-thumb { background: var(--drc-red); border-radius: 4px; }

/* ============================================
   HERO SECTIONS — overlay via Elementor CSS ID
   Uses the element's css_id set in Elementor data.
   This is more reliable than pseudo-selectors.
   ============================================ */

/* Hero sections — overlay + z-index fix
   Elementor v4 e-con-full containers have NO .e-con-inner wrapper.
   Widgets are direct children of the container.
   We must lift each widget above the ::before overlay. */

/* Hero section overlay — target ONLY e-con containers, not widgets.
   We use .e-con to avoid matching hero_heading, hero_button etc. */
[class*="elementor-element-hero_"].e-con {
  position: relative;
}
[class*="elementor-element-hero_"].e-con::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1;
  pointer-events: none;
}
/* Lift direct children above the overlay */
[class*="elementor-element-hero_"].e-con > .e-con-inner,
[class*="elementor-element-hero_"].e-con > .elementor-widget,
[class*="elementor-element-hero_"].e-con > .elementor-element {
  position: relative;
  z-index: 2;
}

/* ============================================
   CAMO SECTION OVERLAYS
   These use Elementor css_id matching.
   Camo bg image is set in Elementor data;
   the overlay here makes text readable.
   ============================================ */

/* Camo section overlays — same z-index fix as hero.
   ::after for overlay, children lifted above it. */

/* Legacy section — light camo (UCP), light overlay */
.elementor-element-legacy_section {
  position: relative;
}
.elementor-element-legacy_section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(245, 245, 245, 0.93);
  z-index: 0;
  pointer-events: none;
}
.elementor-element-legacy_section > .e-con-inner,
.elementor-element-legacy_section > .elementor-widget,
.elementor-element-legacy_section > .elementor-element {
  position: relative;
  z-index: 1;
}

/* Approved source — dark camo (woodland), lighter overlay so camo shows */
.elementor-element-approved_section {
  position: relative;
}
.elementor-element-approved_section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.55);
  z-index: 0;
  pointer-events: none;
}
.elementor-element-approved_section > .e-con-inner,
.elementor-element-approved_section > .elementor-widget,
.elementor-element-approved_section > .elementor-element {
  position: relative;
  z-index: 1;
}

/* Platforms section — light camo (desert), light overlay */
.elementor-element-platforms_section {
  position: relative;
}
.elementor-element-platforms_section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(245, 245, 245, 0.7);
  z-index: 0;
  pointer-events: none;
}
.elementor-element-platforms_section > .e-con-inner,
.elementor-element-platforms_section > .elementor-widget,
.elementor-element-platforms_section > .elementor-element {
  position: relative;
  z-index: 1;
}

/* ============================================
   RESPONSIVE — MOBILE (max 767px)
   ============================================ */
@media (max-width: 767px) {
  .elementor-heading-title { word-break: break-word; }
  .e-con.e-parent > .e-con-inner > .elementor-widget,
  .e-con.e-parent > .elementor-widget {
    animation-duration: 0.3s !important;
    animation-delay: 0.05s !important;
  }

  /* ---- HEADER: keep logo + nav on one row ---- */
  /* Override Elementor's --flex-wrap-mobile:wrap on the outer header container */
  .elementor-46 .elementor-element-e654716 > .e-con-inner {
    flex-wrap: nowrap !important;
    align-items: center !important;
  }
  /* Logo container: visible but not greedy — let space-between do the work */
  .elementor-46 .elementor-element-e185fb0 {
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    min-width: auto !important;
    width: auto !important;
  }
  /* Logo image: fixed size */
  .elementor-46 .elementor-element-387e5de img {
    width: 50px !important;
    height: auto !important;
  }
  /* Nav container: pin to right edge, don't collapse */
  .elementor-46 .elementor-element-ab0a757 {
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    justify-content: flex-end !important;
    width: auto !important;
  }
  /* Right-align hamburger toggle */
  .elementor-46 .elementor-element-074802c .elementor-menu-toggle {
    margin: 0 0 0 auto !important;
  }
  /* Tighten header padding on small screens */
  .elementor-46 .elementor-element-e654716 {
    --padding-left: 16px !important;
    --padding-right: 16px !important;
  }

  /* ---- HERO: shorter on mobile to show below-fold hint ---- */
  [class*="elementor-element-hero_"].e-con {
    min-height: min(460px, 70vh) !important;
  }

  /* ---- HEADINGS: scale down on small screens ---- */
  .elementor-heading-title { font-size: clamp(22px, 6vw, 40px) !important; }

  /* ---- BUTTONS: enforce 44px minimum tap target ---- */
  .elementor-button {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* ---- CONTACT FORM: full-width submit button ---- */
  .elementor-form .elementor-field-group {
    width: 100% !important;
    flex-basis: 100% !important;
  }
  .elementor-form .elementor-button[type="submit"] {
    width: 100% !important;
  }

  /* ---- FOOTER: 2-column condensed layout ---- */
  /* Main footer row: wrap into 2×2 grid instead of 4×1 stack */
  .elementor-47 .elementor-element-773a19f {
    --padding-top: 28px !important;
    --padding-bottom: 20px !important;
    --padding-left: 16px !important;
    --padding-right: 16px !important;
  }
  .elementor-47 .elementor-element-773a19f > .e-con-inner {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 20px 16px !important;
  }
  /* Each child column: exactly 50% minus gap */
  .elementor-47 .elementor-element-01615e5,
  .elementor-47 .elementor-element-769613e,
  .elementor-47 .elementor-element-1cae842,
  .elementor-47 .elementor-element-b594658 {
    width: calc(50% - 8px) !important;
    flex-basis: calc(50% - 8px) !important;
    flex-grow: 0 !important;
    align-items: flex-start !important;
  }
  .elementor-location-footer .elementor-widget-text-editor {
    text-align: left;
  }
  /* Tighter spacing within footer sections */
  .elementor-47 .elementor-heading-title {
    font-size: clamp(13px, 3.5vw, 16px) !important;
    margin-bottom: 6px !important;
  }
  .elementor-47 .elementor-widget-text-editor {
    font-size: 13px !important;
    line-height: 1.5 !important;
  }
  /* Footer nav links: tighter */
  .elementor-47 .elementor-icon-list-items .elementor-icon-list-item a {
    font-size: 13px !important;
    padding: 3px 0 !important;
  }
  /* Copyright bar: compact */
  .elementor-47 .elementor-element-dbc2bcc {
    --padding-top: 12px !important;
    --padding-bottom: 12px !important;
    --padding-left: 16px !important;
    --padding-right: 16px !important;
  }
  .elementor-47 .elementor-element-dbc2bcc .elementor-widget-text-editor {
    font-size: 11px !important;
  }

  /* ---- MOBILE NAV DROPDOWN: dark panel with high-contrast items ---- */
  .elementor-nav-menu--dropdown,
  nav.elementor-nav-menu--dropdown,
  .elementor-46 .elementor-nav-menu--dropdown {
    width: 100% !important;
    background-color: #0A1628 !important;
    border-top: 2px solid #CC0000 !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
  }
  .elementor-nav-menu--dropdown .elementor-item,
  .elementor-nav-menu--dropdown li a.elementor-item {
    padding: 16px 24px !important;
    font-size: 15px !important;
    font-family: 'Oswald', sans-serif !important;
    font-weight: 600 !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    color: #FFFFFF !important;
    background-color: transparent !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease !important;
  }
  /* Hover / focus / current page state — must beat the desktop rule's specificity */
  .elementor-location-header .elementor-nav-menu--dropdown .elementor-item:hover,
  .elementor-location-header .elementor-nav-menu--dropdown .elementor-item:focus,
  .elementor-location-header .elementor-nav-menu--dropdown .elementor-item.elementor-item-active,
  .elementor-location-header .elementor-nav-menu--dropdown .elementor-item.highlighted,
  .elementor-location-header .elementor-nav-menu--dropdown .current-menu-item > a.elementor-item,
  .elementor-location-header .elementor-nav-menu--dropdown .current-menu-ancestor > a.elementor-item {
    color: #FFFFFF !important;
    background-color: #CC0000 !important;
    padding-left: 28px !important;
  }
  /* Remove last item border for cleaner look */
  .elementor-nav-menu--dropdown li:last-child .elementor-item {
    border-bottom: none !important;
  }

  /* ---- BACK-TO-TOP: tighter on small screens ---- */
  #drc-back-to-top { bottom: 16px; right: 16px; width: 44px; height: 44px; }
  /* Hide back-to-top when the mobile nav menu is open (prevents red bar peek) */
  body:has(.elementor-menu-toggle.elementor-active) #drc-back-to-top {
    display: none !important;
  }

  /* ---- HEADER: hide brand name text, show logo + hamburger only ---- */
  .elementor-46 .elementor-element-2ed07f5 { display: none !important; }

  /* ---- PLATFORM / PRODUCT SECTION PADDING ---- */
  #hmmwv, #bradley, #m109, #m113 {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* ---- HOVER EFFECTS: pointer devices only (not touchscreens) ---- */
/* Wrapping in (hover:hover) prevents iOS "stuck hover" on tap       */
@media (hover: hover) {
  .elementor-button:hover,
  .elementor-button:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(204,0,0,0.45) !important;
  }
  /* Animate the INDIVIDUAL platform cards on hover, not the wrapper grid.
     The grid (.plat_grid) was matching `.e-con-inner > .e-con`, which made
     the entire 4-card row lift as one unit. Target each card by its
     Elementor element-ID so only the hovered card moves. */
  .elementor-element-plat_card1:hover,
  .elementor-element-plat_card2:hover,
  .elementor-element-plat_card3:hover,
  .elementor-element-plat_card4:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.28);
  }
  /* Image scale on hover — scoped to the same individual cards */
  .elementor-element-plat_card1:hover .elementor-widget-image img,
  .elementor-element-plat_card2:hover .elementor-widget-image img,
  .elementor-element-plat_card3:hover .elementor-widget-image img,
  .elementor-element-plat_card4:hover .elementor-widget-image img {
    transform: scale(1.04);
  }
}
/* Remove the old unconditional hover rules that were added earlier */
.elementor-button:hover,
.elementor-button:focus {
  /* base state preserved for focus rings via :focus-visible */
}

/* ============================================
   ADMIN BAR OFFSET
   ============================================ */
body.logged-in .elementor-location-header { top: 32px; }
@media (max-width: 782px) {
  body.logged-in .elementor-location-header { top: 46px; }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  .elementor-location-header,
  .elementor-location-footer { position: static !important; }
  * { animation: none !important; }
}

/* ============================================
   HEADER — SCROLLED STATE
   JS adds .header-scrolled when pageYOffset > 100
   ============================================ */
.elementor-location-header {
  transition: box-shadow 0.3s ease, padding 0.3s ease;
}
.header-scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.8) !important;
}
.header-scrolled .elementor-nav-menu--main .elementor-nav-menu > li > a {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

/* ============================================
   HERO HEIGHT CAP
   Elementor snapshotted ~1160px on a large display.
   Cap hero containers so they never exceed ~680px.
   ============================================ */
[class*="elementor-element-hero_"].e-con {
  min-height: min(680px, 90vh) !important;
}

/* ============================================
   BUTTONS — TRANSITIONS (hover rules in @media (hover:hover) below)
   ============================================ */
.elementor-button {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
  will-change: transform;
}
.elementor-button:active {
  transform: translateY(0);
  box-shadow: none !important;
}

/* ============================================
   PLATFORM / PRODUCT CARDS — TRANSITIONS
   Hover rules moved to @media (hover:hover) block
   to prevent iOS "stuck hover" on tap.
   ============================================ */
.elementor-widget-image img {
  transition: transform 0.35s ease;
}

/* Card lift transitions — applied to individual cards only.
   Effect itself is gated by @media (hover:hover) so iOS doesn't get stuck. */
.elementor-element-plat_card1,
.elementor-element-plat_card2,
.elementor-element-plat_card3,
.elementor-element-plat_card4 {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}

/* Product detail rows are NOT clickable wrappers — they're target anchors
   that the platform-card View Details buttons scroll to. Adding a hover
   tint here suggests interactivity that doesn't exist, so it's removed.
   The `transition` rule above (lines 568-579) is now unused but harmless;
   left in place in case CTAs are added per-row later. */

/* ============================================
   FOCUS-VISIBLE — KEYBOARD ACCESSIBILITY
   Gold outline consistent with brand palette.
   ============================================ */
:focus-visible {
  outline: 2px solid var(--drc-gold) !important;
  outline-offset: 3px !important;
}
a:focus-visible,
button:focus-visible,
.elementor-button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--drc-gold) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 4px rgba(196,162,101,0.2) !important;
}

/* ============================================
   SECTION SEPARATION — subtle top borders
   ============================================ */
.elementor-section + .elementor-section,
.e-con.e-parent + .e-con.e-parent {
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* ============================================
   BACK-TO-TOP BUTTON
   ============================================ */
#drc-back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9999;
  width: 44px;
  height: 44px;
  background: var(--drc-red);
  color: var(--drc-white);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
#drc-back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#drc-back-to-top:hover {
  background: var(--drc-red-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(204,0,0,0.4);
}
#drc-back-to-top svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  overflow: visible;
}
#drc-back-to-top svg polyline {
  fill: none;
  stroke: inherit;
  stroke-width: inherit;
}

/* ============================================
   REDUCED MOTION — respect OS preference
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  #drc-back-to-top { transition: opacity 0.15s ease, visibility 0.15s ease; }
}
