/* ========================================
   ASCOM — Custom Styles
   Design System + Components + Pages
   ======================================== */

/* --- CSS Custom Properties --- */
:root {
  /* Brand — DO NOT CHANGE */
  --brand-orange: #ea8927;
  --brand-orange-hover: #d1751b;
  --brand-orange-text: #c4711a; /* WCAG AA compliant for text on white */

  /* Neutral palette */
  --black: #0a0a0a;
  --dark-gray: #1a1a1a;
  --medium-gray: #2a2a2a;
  --text-gray: #888888;
  --light-gray: #f5f5f5;
  --white: #ffffff;

  /* Typography */
  --font-primary: 'Inter', 'Open Sans', system-ui, -apple-system, sans-serif;
  --line-height-base: 1.6;
  --line-height-heading: 1.2;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
}

/* --- Global --- */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-primary);
  font-weight: 400;
  line-height: var(--line-height-base);
  color: var(--dark-gray);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  line-height: var(--line-height-heading);
  color: var(--black);
}

h1 {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

h3 {
  font-weight: 700;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

a {
  color: var(--brand-orange-text);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--brand-orange-hover);
}

/* Skip navigation link (accessibility) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.sr-only:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: 1rem 2rem;
  background: var(--brand-orange);
  color: var(--white);
  z-index: 9999;
  clip: auto;
}

/* --- Navbar --- */
#mainNav {
  transition: box-shadow var(--transition-base);
  padding: 0.75rem 0;
  background: var(--black) !important;
  z-index: 1050;
}
#mainNav.scrolled {
  box-shadow: var(--shadow-md);
}
#mainNav .nav-link {
  color: var(--white) !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.875rem;
  padding: 0.5rem 1rem !important;
  transition: color var(--transition-fast);
}
#mainNav .nav-link:hover,
#mainNav .nav-link.active {
  color: var(--brand-orange) !important;
}
#mainNav .dropdown-menu {
  background: var(--white);
  border: none;
  box-shadow: var(--shadow-md);
  border-top: 3px solid var(--brand-orange);
}
#mainNav .dropdown-item {
  color: var(--dark-gray);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.875rem;
}
#mainNav .dropdown-item:hover {
  background: var(--light-gray);
  color: var(--brand-orange);
}
#mainNav .navbar-toggler {
  border-color: rgba(255,255,255,0.3);
}
#mainNav .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Logo — assets/img/ASCOM_logo-04.png has original colors (white + orange C), no filter needed */
#mainNav .navbar-logo,
footer img[alt="Ascom"] {
  filter: none;
}

/* --- Buttons --- */
.btn-primary {
  background: var(--brand-orange);
  color: var(--white);
  padding: 1rem 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  border-radius: 0;
  transition: all var(--transition-base);
}
.btn-primary:hover {
  background: var(--brand-orange-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  color: var(--white);
}

.btn-outline-light {
  background: transparent;
  color: var(--white);
  padding: 1rem 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 2px solid var(--white);
  border-radius: 0;
  transition: all var(--transition-base);
}
.btn-outline-light:hover {
  background: var(--white);
  color: var(--black);
  transform: translateY(-3px);
}

/* --- Hero Sections --- */
.section-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--black);
  color: var(--white);
  text-align: center;
  padding: var(--space-xl) var(--space-md);
}
.section-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1;
}
.section-hero > .container {
  position: relative;
  z-index: 2;
}
.section-hero h1 {
  color: var(--white);
  margin-bottom: var(--space-sm);
}
.section-hero .lead {
  color: rgba(255,255,255,0.8);
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
}

/* Page hero (shorter, for subpages) */
.page-hero {
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark-gray);
  color: var(--white);
  text-align: center;
  padding: var(--space-lg) var(--space-md);
}
.page-hero h1 {
  color: var(--white);
}

/* --- Stats Bar --- */
.section-stats {
  background: var(--brand-orange);
  padding: var(--space-md) 0;
  color: var(--white);
  text-align: center;
}
.section-stats .stat-number {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  line-height: 1;
  display: block;
}
.section-stats .stat-label {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.9;
  margin-top: 0.5rem;
}

/* --- Service Cards --- */
.card-service {
  border: none;
  border-left: 4px solid transparent;
  transition: all var(--transition-base);
  overflow: hidden;
  height: 100%;
}
.card-service:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
  border-left-color: var(--brand-orange);
}
.card-service .card-img-wrapper {
  height: 280px;
  overflow: hidden;
  background: var(--light-gray);
}
.card-service .card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}
.card-service:hover .card-img-wrapper img {
  transform: scale(1.05);
}
.card-service .card-body {
  padding: 1.5rem;
}
.card-service .card-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}
.card-service .card-text {
  color: var(--text-gray);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.card-service .card-link {
  color: var(--brand-orange-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.875rem;
}
.card-service .card-link::after {
  content: '\2192';
  transition: margin-left var(--transition-fast);
  display: inline-block;
  margin-left: 4px;
}
.card-service .card-link:hover::after {
  margin-left: 10px;
}
.card-service .card-link:hover {
  color: var(--brand-orange-hover);
}

/* --- Features Section --- */
.section-features {
  padding: var(--space-lg) 0;
  background: var(--light-gray);
}
.feature-item {
  padding: var(--space-md);
  border-left: 4px solid var(--brand-orange);
  background: var(--white);
  margin-bottom: var(--space-sm);
}
.feature-item h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.feature-item p {
  color: var(--text-gray);
  margin: 0;
}

/* --- Clients Section --- */
.section-clients {
  padding: var(--space-lg) 0;
  text-align: center;
}
.section-clients h2 {
  margin-bottom: var(--space-md);
}
.client-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  align-items: center;
}
.client-logos img {
  height: 60px;
  width: auto;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: all var(--transition-base);
}
.client-logos img:hover {
  filter: grayscale(0%);
  opacity: 1;
}

/* Horizontal auto-scrolling marquee for client logos */
.client-marquee {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: var(--space-sm) 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.client-track {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  width: max-content;
  animation: client-scroll 45s linear infinite;
}
.client-marquee:hover .client-track {
  animation-play-state: paused;
}
.client-track img {
  height: 55px;
  width: auto;
  flex-shrink: 0;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: filter var(--transition-base), opacity var(--transition-base);
}
.client-track img:hover {
  filter: grayscale(0%);
  opacity: 1;
}
@keyframes client-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .client-track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }
}

/* --- Testimonial Section --- */
.section-testimonial {
  background: var(--black);
  color: var(--white);
  padding: var(--space-lg) 0;
  text-align: center;
}
.section-testimonial blockquote {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-style: italic;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto var(--space-sm);
  color: var(--white);
}
.section-testimonial cite {
  color: var(--text-gray);
  font-style: normal;
  font-size: 0.95rem;
}

/* --- CTA Section --- */
.section-cta {
  background: linear-gradient(135deg, var(--dark-gray) 0%, var(--black) 100%);
  color: var(--white);
  padding: var(--space-lg) 0;
  text-align: center;
}
.section-cta h2 {
  color: var(--white);
  margin-bottom: var(--space-xs);
}
.section-cta .lead {
  color: rgba(255,255,255,0.7);
  margin-bottom: var(--space-md);
}

/* --- Alternating Expertise Layout --- */
.section-expertise-item {
  padding: var(--space-lg) 0;
}
.section-expertise-item:nth-child(odd) {
  background: var(--white);
}
.section-expertise-item:nth-child(even) {
  background: var(--light-gray);
}
.expertise-image {
  text-align: center;
  margin-bottom: var(--space-md);
}
.expertise-image img {
  max-width: 100%;
  height: auto;
}
.expertise-content h3 {
  margin-bottom: var(--space-sm);
}
.expertise-content p {
  color: var(--text-gray);
  line-height: 1.8;
}

/* --- Staff Grid --- */
.staff-card {
  text-align: center;
  padding: var(--space-md);
  border: 1px solid rgba(0,0,0,0.08);
  transition: all var(--transition-base);
  height: 100%;
}
.staff-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-orange);
}
.staff-card h5 {
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.staff-card .staff-role {
  color: var(--brand-orange-text);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}
.staff-card .staff-contact {
  color: var(--text-gray);
  font-size: 0.875rem;
}
.staff-card .staff-contact a {
  color: var(--text-gray);
}
.staff-card .staff-contact a:hover {
  color: var(--brand-orange-text);
}

/* --- Contact Info Block --- */
.contact-info {
  padding: var(--space-md);
  background: var(--light-gray);
  border-left: 4px solid var(--brand-orange);
}
.contact-info h5 {
  font-weight: 700;
  margin-bottom: var(--space-sm);
}
.contact-info p {
  margin-bottom: 0.5rem;
  color: var(--text-gray);
}
.contact-info a {
  color: var(--brand-orange-text);
}

/* --- Map Placeholder --- */
.map-placeholder {
  background: var(--medium-gray);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.125rem;
}

/* --- Map Embed (Google Maps iframe) --- */
/* In a flex-column map column, the map grows to match the contact info height. */
.map-embed {
  flex: 1 1 auto;
  min-height: 0;
  border-left: 4px solid var(--brand-orange);
  overflow: hidden;
}
.map-embed iframe {
  width: 100%;
  height: 100%;
  display: block;
}
/* On stacked layouts the column no longer matches the info height: give it a floor. */
@media (max-width: 991.98px) {
  .map-embed {
    min-height: 380px;
  }
}

/* --- Footer --- */
footer {
  background: var(--black);
  color: var(--white);
}
/* Override Bootstrap .text-muted on dark footer bg */
footer .text-muted {
  color: rgba(255,255,255,0.6) !important;
}
footer a.footer-link {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color var(--transition-fast);
}
footer a.footer-link:hover {
  color: var(--brand-orange);
}
footer hr {
  border-color: rgba(255,255,255,0.1);
}

/* --- Project Detail Page --- */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-md);
}
.project-gallery img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 0;
  transition: transform var(--transition-base);
}
.project-gallery img:hover {
  transform: scale(1.02);
}

/* --- Breadcrumb --- */
.breadcrumb-item a {
  color: var(--brand-orange-text);
}
.breadcrumb-item.active {
  color: var(--text-gray);
}

/* --- Form Styles --- */
.form-control:focus {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 0.2rem rgba(234,137,39,0.25);
}
.form-label {
  font-weight: 600;
  color: var(--dark-gray);
}

/* --- Section Padding (generic) --- */
.section-padding {
  padding: var(--space-lg) 0;
}

/* --- Competence Pillars (Expertise page) --- */
.competence-card {
  background: var(--white);
  border-top: 4px solid var(--brand-orange);
  padding: var(--space-md);
  height: 100%;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.competence-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}
.competence-icon {
  width: 56px;
  height: 56px;
  color: var(--brand-orange);
  margin-bottom: var(--space-sm);
}
.competence-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.competence-card h3 {
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}
.competence-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.competence-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-gray);
  font-size: 0.95rem;
  line-height: 1.5;
}
.competence-list li::before {
  content: '\2192';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--brand-orange);
  font-weight: 700;
}

/* --- Process Timeline (Expertise page) --- */
.process-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-md);
}
.process-step {
  position: relative;
  padding-top: var(--space-sm);
  border-top: 2px solid rgba(0,0,0,0.08);
}
.process-step .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--brand-orange);
  color: var(--white);
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: var(--space-sm);
}
.process-step h4 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}
.process-step p {
  color: var(--text-gray);
  font-size: 0.9rem;
  margin: 0;
}

/* --- Expertise deep-dive: dark render images sit well on dark frame --- */
.expertise-figure {
  background: var(--dark-gray);
  overflow: hidden;
}
.expertise-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 320px;
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
  #mainNav .nav-link {
    color: var(--white) !important;
    padding: 0.75rem 0 !important;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  #mainNav .nav-link:hover,
  #mainNav .nav-link.active {
    color: var(--brand-orange) !important;
  }
  #mainNav .navbar-logo {
    filter: none; /* No filter on mobile (dark bg navbar) */
  }
  #mainNav.scrolled .navbar-logo {
    filter: none;
  }
  .section-hero {
    min-height: 80vh;
  }
  .section-stats .row > div {
    margin-bottom: var(--space-sm);
  }
}

@media (max-width: 767.98px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .section-hero {
    min-height: 70vh;
    padding: var(--space-lg) var(--space-sm);
  }
  .section-hero .lead {
    font-size: 1rem;
  }
  .btn-primary, .btn-outline-light {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
  }
  .card-service .card-img-wrapper {
    height: 200px;
  }
  .project-gallery {
    grid-template-columns: 1fr;
  }
}
