/* ===================================================================
   Matchwell Engineering — Organization Chart Redesign
   Theme: Modern Industrial Minimalism
   Features: CSS Grid/Flexbox hierarchical tree with pseudo-element connectors
=================================================================== */

/* --- Page Root --- */
.mw-org-root {
  font-family: 'Inter', sans-serif;
  background-color: var(--mw-bg-light);
  color: var(--mw-text-main);
  padding-bottom: 80px;
}

/* --- Hero Section --- */
.mw-org-hero {
  position: relative;
  width: 100%;
  height: 400px;
  background: url('https://matchwell.in/wp-content/uploads/2022/12/about-slider.jpg') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.mw-org-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 25, 47, 0.7); /* Deep blue overlay */
  z-index: 1;
}

.mw-org-hero-content {
  position: relative;
  z-index: 2;
  padding: 0 20px;
}

.mw-org-hero-title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--mw-white);
  text-transform: uppercase;
  margin: 0;
  letter-spacing: 1px;
}

/* --- Container --- */
.mw-org-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px;
  overflow-x: auto;
}

/* --- Organization Chart Grid (Desktop) --- */
.mw-org-grid-wrapper {
  overflow-x: auto;
  padding: 40px 20px;
}

.mw-org-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: auto;
  min-width: 1100px;
  column-gap: 0;
  max-width: 1400px;
  margin: 0 auto;
}

/* --- Connecting Lines --- */
.line-h {
  height: 30px;
  border-top: 2px solid var(--mw-primary-color);
}

.line-left {
  width: 50%;
  justify-self: end;
  border-left: 2px solid var(--mw-primary-color);
}

.line-right {
  width: 50%;
  justify-self: start;
  border-right: 2px solid var(--mw-primary-color);
}

.line-full {
  width: 100%;
}

.line-full-drop {
  width: 100%;
  border-top: 2px solid var(--mw-primary-color);
  position: relative;
  height: 30px;
}

.line-full-drop::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 30px;
  background: var(--mw-primary-color);
}

.drop-line {
  width: 2px;
  height: 30px;
  background: var(--mw-primary-color);
  justify-self: center;
}

/* --- Wrappers --- */
.mw-org-card-wrap, .mw-org-dept-wrap {
  display: flex;
  justify-content: center;
  padding: 0 10px;
}

/* --- Top Level Cards --- */
.mw-org-card {
  display: flex;
  align-items: stretch; /* Let icon stretch */
  background: var(--mw-white);
  border: 2px solid var(--mw-primary-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--mw-shadow-sm);
  width: 100%;
  max-width: 320px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mw-org-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--mw-shadow-md);
}

.mw-org-card-icon {
  background: var(--mw-primary-color);
  color: var(--mw-white);
  width: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 40px 40px 0; /* Curved right edge */
  flex-shrink: 0;
}

.mw-org-card-text {
  padding: 15px 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mw-org-card-text strong {
  display: block;
  color: var(--mw-primary-color);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.mw-org-card-text span {
  color: var(--mw-text-main);
  font-size: 0.9rem;
}

/* Specific Card Styling */
.mw-org-tandon {
  border-color: #0b153b;
}
.mw-org-tandon .mw-org-card-icon {
  background: #0b153b;
}
.mw-org-tandon .mw-org-card-text strong {
  color: #0b153b;
}

.mw-org-cmo {
  border-color: #518ece;
}
.mw-org-cmo .mw-org-card-icon {
  background: #518ece;
}
.mw-org-cmo .mw-org-card-text strong {
  color: #0b153b;
}

.mw-org-ceo {
  border-color: #034b9d;
}
.mw-org-ceo .mw-org-card-icon {
  background: #034b9d;
}
.mw-org-ceo .mw-org-card-text strong {
  color: #0b153b;
}

/* --- Department Cards --- */
.mw-org-dept-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--mw-white);
  border: 2px solid var(--mw-primary-color);
  border-radius: 12px;
  padding: 20px 5px;
  box-shadow: var(--mw-shadow-sm);
  text-align: center;
  width: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mw-org-dept-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--mw-shadow-md);
}

.mw-org-dept-icon {
  background: var(--mw-primary-color);
  color: var(--mw-white);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
}

.mw-org-dept-card strong {
  color: var(--mw-primary-color);
  font-size: 0.95rem;
  line-height: 1.3;
}

/* --- Responsive Styles (Mobile / Tablet) --- */
@media (max-width: 1024px) {
  .mw-org-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: unset;
    max-width: 400px;
    margin: 0 auto;
  }
  
  .line-h, .drop-line {
    display: none !important;
  }
  
  .mw-org-card-wrap, .mw-org-dept-wrap {
    grid-column: unset !important;
    grid-row: unset !important;
    padding: 0;
  }
  
  .mw-org-dept-card {
    flex-direction: row;
    padding: 15px 20px;
    align-items: center;
    text-align: left;
  }
  
  .mw-org-dept-icon {
    margin-bottom: 0;
    margin-right: 15px;
    flex-shrink: 0;
  }
}
