/* 
 * ESP Company Page Styles
 * Scope all styles to .esp-company-page to avoid conflicts
 */

.esp-company-page {
    --primary: var(--e-global-color-primary, #9C0002);
    --primary-dark: #7a0001;
    --primary-light: rgba(156,0,2,0.6);
    --dark: #1a1a1a;
    --gray: #333;
    --light: #f5f7fa;
    --white: #ffffff;
    --thk: clamp(4px, 0.4vw, 6px) solid transparent;
    --offcet: clamp(18px, 1.6vw, 22px);
    --content-padding: calc(2.1 * var(--offcet));
    
    font-family: 'Rajdhani', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--white);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Base layout constraints */
.esp-company-page .container {
    width: 95%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

/* Typography Classes */
.esp-company-page .ph {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    color: var(--dark);
}

.esp-company-page .pt {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 400;
    color: var(--gray);
    line-height: 1.6;
}

/* Section Styles */
.esp-company-page .section {
    padding: 5rem 0;
}

.esp-company-page .section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.esp-company-page .section-title .ph {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.esp-company-page .section-title .ph:after {
    content: '';
    position: absolute;
    width: 80px;
    height: 5px;
    background: var(--primary);
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
}

.esp-company-page .section-title .pt {
    max-width: 700px;
    margin: 2rem auto 0;
    font-size: 1.1rem;
}

/* Button Styles */
.esp-company-page .btn {
    display: inline-block;
    background: rgba(152, 193, 217, 0.3);
    color: var(--dark);
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none !important;
    border-radius: 0;
}

.esp-company-page .hero-content .btn,
.esp-company-page .esp-project-content .btn {
    color: var(--white);
}

.esp-company-page .btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--primary);
    transition: height 0.3s ease;
    z-index: -1;
}

.esp-company-page .btn:hover::after {
    height: 100%;
}

.esp-company-page .btn:hover {
    /* hover vertical transform removed */
    box-shadow: 0 5px 15px rgba(156, 0, 2, 0.3);
    color: var(--white) !important;
}

.esp-company-page .btn:focus {
    color: var(--white);
}

/* =========================================
   1. Hero Section with Parallax
========================================= */
.esp-company-page .hero-section {
    min-height: auto;
    padding: 220px 0 120px 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    z-index: 1;
}

.esp-company-page .parallax-bg {
    position: absolute;
    top: -30%;
    left: 0;
    width: 100%;
    height: 160%;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.esp-company-page .parallax-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.6));
    z-index: 1;
}

.esp-company-page .hero-content {
    max-width: 800px;
    padding: 2rem;
    position: relative;
    z-index: 2;
    animation: fadeInUp 1.5s ease-out;
    margin-top: -6vh;
}

.esp-company-page .hero-content .ph {
    font-size: clamp(3rem, 8vw, 5rem);
    margin-bottom: 1.5rem;
    color: var(--white);
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    text-transform: uppercase;
    letter-spacing: 4px;
}

.esp-company-page .hero-content .pt {
    font-size: 1.4rem;
    margin-bottom: 2rem;
    color: var(--white);
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   2. Organization Chart
========================================= */
.esp-company-page .org-chart {
    padding: 2rem;
    background: #f8f9fa;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    border-radius: 0;
    box-sizing: border-box;
}

.esp-company-page .org-description {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2rem;
}

.esp-company-page .org-simplified {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1.5rem;
}

.esp-company-page .org-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.esp-company-page .org-item {
    padding: 1.5rem;
    text-align: center;
    min-width: 200px;
    background: var(--white);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.09);
    position: relative;
    z-index: 2;
    border-radius: 0;
    box-sizing: border-box;
    flex: 0 1 auto;
    transition: box-shadow 0.3s ease;
}

.esp-company-page .org-item:hover {
    /* hover vertical transform removed */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.esp-company-page .org-item.board {
    background: #ADC3CE;
    color: var(--white) !important;
}

.esp-company-page .org-item.ceo {
    background: var(--primary);
    color: var(--white) !important;
}

.esp-company-page .org-item.ceo .ph,
.esp-company-page .org-item.ceo .pt,
.esp-company-page .org-item.board .ph,
.esp-company-page .org-item.board .pt {
    color: var(--white);
}

.esp-company-page .org-item .ph {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.esp-company-page .org-item .pt {
    font-weight: 500;
    opacity: 0.9;
    text-align: center !important;
}

/* =========================================
   3. ESP Project Section
========================================= */
.esp-company-page .esp-project-section {
    height: auto;
    padding: 120px 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    z-index: 1;
}

.esp-company-page .esp-parallax-bg {
    position: absolute;
    top: -30%;
    left: 0;
    width: 100%;
    height: 160%;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.esp-company-page .esp-parallax-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.65));
    z-index: 1;
}

.esp-company-page .esp-project-content {
    max-width: 800px;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.esp-company-page .esp-project-content .ph {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--white);
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
}

.esp-company-page .esp-project-content .pt {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--white);
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

/* =========================================
   4. ISO Section & Values Section
========================================= */
.esp-company-page .iso-section,
.esp-company-page .values-section,
.esp-company-page .resources-section {
    padding: 5rem 0;
    background: var(--white);
}

.esp-company-page .iso-grid,
.esp-company-page .values-grid,
.esp-company-page .resources-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 3rem;
    justify-content: center;
}

.esp-company-page .iso-card,
.esp-company-page .value-card,
.esp-company-page .resource-card {
    text-align: center;
    padding: 2.5rem;
    background: #f8f9fa;
    transition: box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.09);
    width: clamp(250px, 25vw, 350px);
    height: auto;
}

.esp-company-page .iso-card .pt,
.esp-company-page .value-card .pt,
.esp-company-page .resource-card .pt {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.esp-company-page .iso-card:hover,
.esp-company-page .value-card:hover,
.esp-company-page .resource-card:hover {
    /* hover vertical transform removed */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.esp-company-page .iso-icon,
.esp-company-page .value-icon,
.esp-company-page .resource-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.esp-company-page .iso-card:hover .iso-icon,
.esp-company-page .value-card:hover .value-icon,
.esp-company-page .resource-card:hover .resource-icon {
    transform: scale(1.1);
}

.esp-company-page .iso-card .ph,
.esp-company-page .value-card .ph,
.esp-company-page .resource-card .ph {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.esp-company-page .iso-button,
.esp-company-page .chart-button-section {
    text-align: center;
    margin-top: 5rem;
}

/* Value Card Animated Border */
.esp-company-page .value-card::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 2;
    bottom: var(--offcet);
    right: var(--offcet);
    border-bottom: var(--thk);
    border-right: var(--thk);
}

.esp-company-page .value-card.animated::before {
    width: calc(100% - (2 * var(--offcet)));
    height: calc(100% - (2 * var(--offcet)));
    border-bottom-color: var(--primary);
    border-right-color: var(--primary-light);
}

/* Certificate Popup Styles */
.esp-company-page .certificate-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.esp-company-page .certificate-popup.active {
    display: flex;
}

.esp-company-page .certificate-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.esp-company-page .certificate-image {
    max-width: 100%;
    max-height: 80vh;
    display: block;
}

.esp-company-page .close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    background: var(--primary);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.esp-company-page .close-popup:hover {
    background: var(--primary-dark);
}

/* =========================================
   5. Full Chart Section
========================================= */
.esp-company-page .full-chart-section {
    background: #f8f9fa;
    padding: 5rem 0;
    text-align: center;
}

.esp-company-page .full-chart-content {
    max-width: 700px;
    margin: 0 auto;
}

.esp-company-page .full-chart-content .ph {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.esp-company-page .full-chart-content .pt {
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

/* End Corporate Resources */

/* Responsive Design */
@media (max-width: 768px) {
    .esp-company-page .hero-content .ph {
        font-size: 2.5rem;
    }
    
    .esp-company-page .hero-content .pt {
        font-size: 1.2rem;
    }
    
    .esp-company-page .esp-project-content .ph {
        font-size: 2rem;
    }
    
    .esp-company-page .esp-project-content .pt {
        font-size: 1.1rem;
    }
    
    .esp-company-page .section {
        padding: 3rem 0;
    }
    
    .esp-company-page .org-row {
        flex-direction: column;
        align-items: center;
    }
    
    .esp-company-page .org-item {
        width: 100%;
        max-width: 300px;
    }
    
    .esp-company-page .iso-grid, 
    .esp-company-page .values-grid {
        grid-template-columns: 1fr;
    }
    
    .esp-company-page .certificate-content {
        max-width: 95%;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .esp-company-page .hero-content .ph {
        font-size: 2rem;
    }
    
    .esp-company-page .hero-content .pt {
        font-size: 1rem;
    }
    
    .esp-company-page .esp-project-content .ph {
        font-size: 1.8rem;
    }
    
    .esp-company-page .section-title .ph {
        font-size: 1.8rem;
    }
    
    .esp-company-page .iso-card, 
    .esp-company-page .value-card,
    .esp-company-page .resource-card {
        padding: 1.5rem;
        width: 100%;
    }
}

/* =========================================
   8. Stats Section
========================================= */
.esp-company-page .stats-section {
    padding: clamp(4rem, 8vw, 6rem) 0;
    border-radius: 0;
    text-align: center;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    position: relative;
    left: 0;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.esp-company-page .stats-section .section-title {
    position: relative;
    z-index: 1;
}

.esp-company-page .stats-section .section-title .ph {
    color: white;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
}

.esp-company-page .stats-section .section-title .ph:after {
    background: rgba(255, 255, 255, 0.3);
}

.esp-company-page .stats-section .section-title p {
    color: rgba(255, 255, 255, 0.9);
}

.esp-company-page .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    max-width: 80%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.esp-company-page .stat-item {
    text-align: center;
}

.esp-company-page .stat-number::before {
    content: '+';
    margin-left: 2px;
}

.esp-company-page .stat-number {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
}

.esp-company-page .stat-label {
    font-size: clamp(0.5rem, 2vw, 1.2rem);
    font-weight: 600;
    color: #fff;
}

@media (max-width: 1024px) {
    .esp-company-page .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .esp-company-page .stats-grid {
        grid-template-columns: repeat(2, 1fr); 
        grid-template-rows: repeat(2, auto); 
        gap: 2rem;
    }
    
    .esp-company-page .stat-number {
        font-size: 2.5rem;
    }
}

/* =========================================
   7. Parallax Full-Width Bleed
========================================= */
.esp-company-page .hero-section,
.esp-company-page .esp-project-section {
    width: 100vw !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    box-sizing: border-box;
}

/* =========================================
   8. Hero Nav Buttons (Stacked, Fade Hover)
========================================= */
.esp-company-page .hero-nav-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--white) !important;
    text-decoration: none !important;
    font-family: var(--font-heading-tech2, 'Rajdhani', sans-serif);
    font-size: 1.2rem;
    font-weight: 500;
    transition: background-color 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), color 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-align: center;
    border-radius: 0;
}

.esp-company-page .hero-nav-btn:hover {
    background-color: rgba(255, 255, 255, 1);
    color: var(--primary) !important;
}

/* =========================================================
   CUSTOMIZATIONS: EXACT MATCH TO SERVICES PAGE
   ========================================================= */

/* 1. Descriptions Centered & Styled (توضیحات وسط چین و اختصاصی) */
/* This matches the precise look of the descriptions in the Services page */
.esp-company-page .section-title p,
.esp-company-page .hero-content p,
.esp-company-page .esp-project-content p,
.esp-company-page .org-description p {
    font-size: clamp(1.1rem, 3vw, 1.4rem) !important;
    max-width: 800px;
    margin-left: auto !important;
    margin-right: auto !important;
    opacity: 0.9;
    line-height: 1.8;
    text-align: center !important; /* Overrides the global justify !important */
}

/* 2. Make Value Cards Left-Aligned (بعضی چپ چین بشن) */
/* This forces the Our Services & Core Values cards to be left-aligned like the Services page */
.esp-company-page .value-card {
    text-align: left !important;
    align-items: flex-start !important;
}

/* Force the paragraph inside the left-aligned cards to actually be left-aligned */
.esp-company-page .value-card .pt {
    justify-content: flex-start !important;
    text-align: left !important;
}

/* (The ISO and Resource cards remain centered as defined originally) */

/* Ensure ISO and Resource cards stay centered against global justify */
.esp-company-page .iso-card .pt,
.esp-company-page .resource-card .pt {
    text-align: center !important;
}
