/* ==========================================================================
   BAE SATCOM Custom Overrides — bae-custom.css
   Resolves inline-CSS / Dronza-theme conflicts and adds mobile responsiveness
   Version: 1.0.0
   ========================================================================== */

/* --------------------------------------------------------------------------
   A) MOBILE-RESPONSIVE TABLES
   Blog posts (1163-1168) and service pages (1285 EW etc.) use inline-styled
   tables that overflow on mobile. Wrap them in a scrollable container.
   -------------------------------------------------------------------------- */
article table,
.blog-post table,
.content-section table,
.esa-page table {
  width: 100%;
  overflow-x: auto;
  display: block;
  -webkit-overflow-scrolling: touch;
}

article table thead,
article table tbody,
article table tr,
.blog-post table thead,
.blog-post table tbody,
.blog-post table tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

@media (max-width: 768px) {
  article table,
  .content-section table,
  .esa-page table {
    font-size: 0.85rem;
  }
  article table td,
  article table th,
  .content-section table td,
  .content-section table th,
  .esa-page table td,
  .esa-page table th {
    padding: 8px 10px;
    white-space: nowrap;
  }
}

/* --------------------------------------------------------------------------
   B) HERO SECTIONS — work with Dronza theme wrapper
   Blog posts use .hero-section with inline padding/font-size that can
   collide with Dronza's own hero patterns. Ensure proper stacking and
   responsive type scaling.
   -------------------------------------------------------------------------- */
.hero-section {
  position: relative;
  z-index: 1;
}

.hero-section h1 {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hero-eyebrow {
  display: block;
}

.content-section {
  position: relative;
}

/* Service CPT hero (.hero class from 1283/1284) */
.esa-page .hero {
  position: relative;
  z-index: 1;
}

.esa-page .hero h1 {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

@media (max-width: 768px) {
  .hero-section h1 {
    font-size: 2rem !important;
  }
  .hero-subtitle {
    font-size: 1rem !important;
  }
  .content-section {
    padding: 2rem 1rem !important;
  }

  /* Service CPT pages — hero text */
  .esa-page .hero h1,
  [style*="font-size: 48px"],
  [style*="font-size: 3rem"] {
    font-size: 1.75rem !important;
  }
  [style*="font-size: 20px"][style*="max-width: 680px"],
  .hero-intro {
    font-size: 1rem !important;
  }

  /* FAQ hero */
  .faq-hero h1 {
    font-size: 2rem !important;
  }
  .faq-hero-intro {
    font-size: 1rem !important;
  }
}

/* --------------------------------------------------------------------------
   C) GRID LAYOUTS — collapse to single column on mobile
   Service pages (1285-1288) use inline grid-template-columns: repeat(4,1fr)
   and .hero-specs, .tech-grid, .platform-grid classes in 1283/1284.
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  .hero-specs,
  .tech-grid,
  .platform-grid,
  .blog-grid {
    grid-template-columns: 1fr !important;
  }

  /* FAQ specs grid */
  .faq-specs-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Tablet breakpoint — 2 columns for grids */
@media (min-width: 769px) and (max-width: 1024px) {
  [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .hero-specs {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .faq-specs-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* --------------------------------------------------------------------------
   D) CALLOUT / BLOCKQUOTE — prevent text overflow
   Blog posts (1163, 1165, 1166) use blockquotes and .callout boxes.
   -------------------------------------------------------------------------- */
blockquote,
.callout {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

blockquote p,
.callout p {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* --------------------------------------------------------------------------
   E) DARK-THEME PAGE ISOLATION
   FAQ (121) injects a full <style> block with :root overrides (--color-bg: #0a0a0f)
   and body { background: var(--color-bg) } that bleeds into Dronza's light shell
   (header, footer, nav). Service pages (1285-1288) also use inline
   background: #0a0a0a on sections. Scope dark styles so Dronza chrome stays clean.
   -------------------------------------------------------------------------- */

/* Ensure Dronza header/nav/footer are NOT overridden by page-level dark vars */
body .site-header,
body .main-header,
body .site-footer,
body .main-footer,
body #masthead,
body #colophon,
body .navigation,
body .main-navigation {
  background-color: initial;
  color: initial;
}

/* FAQ page — constrain dark background to the content area only */
.faq-container {
  background: var(--color-bg, #0a0a0a);
  color: var(--color-text, #e0e0e8);
}

/* Service pages — dark sections should not bleed outside article */
.esa-page [style*="background: #0a0a0a"],
.esa-page [style*="background: #111"] {
  position: relative;
}

/* Ensure links inside dark-themed content remain visible */
.faq-container a,
.esa-page a {
  color: inherit;
}

.faq-container a:hover,
.esa-page a:hover {
  opacity: 0.8;
}

/* Connect page (122) — dark-themed contact cards */
[style*="background: rgba(255,255,255,0.03)"] {
  position: relative;
}

/* --------------------------------------------------------------------------
   F) CTA BUTTONS — consistent treatment across all pages
   Used in blog posts (.cta-button) and FAQ (.faq-cta-button).
   -------------------------------------------------------------------------- */
.cta-button {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: #e63946;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.9rem;
  transition: opacity 0.2s;
  border: none;
  cursor: pointer;
}

.cta-button:hover {
  opacity: 0.85;
  color: #fff;
  text-decoration: none;
}

.faq-cta-button {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: #e63946;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.9rem;
  transition: opacity 0.2s;
  border: none;
  cursor: pointer;
}

.faq-cta-button:hover {
  opacity: 0.85;
  color: #fff;
  text-decoration: none;
}

/* CTA section wrapper */
.cta-section {
  text-align: center;
}

@media (max-width: 768px) {
  .cta-button,
  .faq-cta-button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 1rem 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   G) GENERAL RESPONSIVE FIXES
   Images, figures, and misc elements that inline styles don't cover.
   -------------------------------------------------------------------------- */
img {
  max-width: 100%;
  height: auto;
}

figure {
  margin: 2rem 0;
  max-width: 100%;
}

figcaption {
  font-size: 0.85rem;
  opacity: 0.6;
  margin-top: 0.5rem;
}

/* Service page stat numbers — scale down on mobile */
@media (max-width: 768px) {
  [style*="font-size: 36px"][style*="font-weight: bold"] {
    font-size: 1.5rem !important;
  }
  [style*="padding: 40px 24px"] {
    padding: 20px 16px !important;
  }
  [style*="padding: 80px 40px"] {
    padding: 40px 20px !important;
  }
}

/* --------------------------------------------------------------------------
   H) DRONZA THEME INTEGRATION — ensure post content sits cleanly
   -------------------------------------------------------------------------- */
.entry-content .blog-post,
.entry-content .esa-page,
.entry-content .faq-container {
  max-width: 100%;
  overflow-x: hidden;
}

/* Prevent Dronza's default content width from conflicting with
   the inline max-width on .content-section */
.entry-content .content-section {
  margin-left: auto;
  margin-right: auto;
}

/* Service page .container class — avoid collision with Dronza's own .container */
.esa-page .container {
  max-width: 100%;
  padding-left: 2rem;
  padding-right: 2rem;
}

@media (max-width: 768px) {
  .esa-page .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Hide testimonial quote marks and restyle as domain showcase */
.testimonial-section .quote-icon,
.testimonial-section .fa-quote-left,
.testimonial-section .fa-quote-right,
.testimonial-section blockquote::before,
.testimonial-section blockquote::after,
.testm-slider-wrap .quote-icon,
.testm-slider-wrap .fa-quote-left,
.dronza-testimonials .quote-icon,
.dronza-testimonials .fa-quote-left,
.dronza_testimonial_slide::before,
.testm-inner-text::before {
  display: none !important;
  content: none !important;
}

/* Hide profile images in domain cards */
.testm-slider-wrap .testm-author-img,
.dronza-testimonials .testm-author-img {
  display: none !important;
}

/* Global accent color override: yellow/lime -> red */
[style*="#c8ff00"], [style*="color: #c8ff00"] {
  color: #e63946 !important;
}
[style*="background: #c8ff00"], [style*="background-color: #c8ff00"] {
  background: #e63946 !important;
  background-color: #e63946 !important;
}
[style*="border-color: #c8ff00"], [style*="border.*#c8ff00"] {
  border-color: #e63946 !important;
}
.hero-spec-value, .hero-label, .hero-eyebrow {
  color: #e63946 !important;
}

/* FAQ page spec grid and nav fixes */
.entry-content > section > div[style*="display: flex"][style*="border: 1px solid #333"] {
  display: flex !important;
  flex-wrap: wrap !important;
}
.entry-content > section > div[style*="display: flex"] > div[style*="flex: 1"] {
  flex: 1 1 22% !important;
  min-width: 150px !important;
}
.entry-content > nav > div[style*="display: flex"] {
  display: flex !important;
  flex-wrap: nowrap !important;
}
.entry-content > nav > div > a[style*="flex: 1"] {
  flex: 1 1 auto !important;
}
@media (max-width: 600px) {
  .entry-content > section > div[style*="display: flex"] > div[style*="flex: 1"] {
    flex: 1 1 45% !important;
  }
  .entry-content > nav > div[style*="display: flex"] {
    flex-wrap: wrap !important;
  }
  .entry-content > nav > div > a[style*="flex: 1"] {
    flex: 1 1 45% !important;
  }
}
