/**
 * ENGR Brand Guide Styles
 * Version: 1.1.0
 * 
 * These styles are scoped to .engr-* classes to avoid
 * conflicts with Divi theme styles.
 */

/* ============================================
   CSS Custom Properties (Brand Variables)
   ============================================ */
:root {
    --engr-purple: #6A0DAD;
    --engr-purple-light: rgba(106, 13, 173, 0.1);
    --engr-black: #000000;
    --engr-white: #FFFFFF;
    --engr-dark-gray: #191C28;
    --engr-light-gray: #F8FAFC;
    --engr-mid-gray: #64748B;
    --engr-border: #E2E8F0;
    --engr-success: #22C55E;
    --engr-success-bg: rgba(34, 197, 94, 0.1);
    --engr-error: #EF4444;
    --engr-error-bg: rgba(239, 68, 68, 0.1);
    --engr-font-family: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --engr-radius: 12px;
    --engr-radius-sm: 8px;
    --engr-radius-pill: 20px;
    --engr-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --engr-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.12);
    --engr-transition: all 0.2s ease;
}

/* ============================================
   Base Container
   ============================================ */
.engr-brand-guide {
    font-family: var(--engr-font-family);
    color: var(--engr-black);
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.engr-brand-guide *,
.engr-brand-guide *::before,
.engr-brand-guide *::after {
    box-sizing: border-box;
}

.engr-brand-guide a {
    color: var(--engr-purple);
    text-decoration: none;
    transition: var(--engr-transition);
}

.engr-brand-guide a:hover {
    text-decoration: underline;
}

/* ============================================
   Hero Section
   ============================================ */
.engr-hero {
    background: linear-gradient(135deg, var(--engr-dark-gray) 0%, #2d1f47 100%);
    color: var(--engr-white);
    padding: 60px 48px;
    border-radius: var(--engr-radius);
    margin-bottom: 48px;
    position: relative;
    overflow: hidden;
}

.engr-hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: radial-gradient(circle at 70% 30%, rgba(106, 13, 173, 0.3) 0%, transparent 50%);
    pointer-events: none;
}

.engr-hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

.engr-hero h1 {
    font-size: 48px;
    font-weight: 800;
    margin: 0 0 16px 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--engr-white);
}

.engr-hero-tagline {
    font-size: 24px;
    font-style: italic;
    color: var(--engr-purple);
    margin-bottom: 20px;
}

.engr-hero p {
    font-size: 17px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.7;
}

.engr-hero-version {
    margin-top: 32px;
    font-size: 13px;
    opacity: 0.5;
    letter-spacing: 0.02em;
}

/* ============================================
   Sections
   ============================================ */
.engr-section {
    margin-bottom: 64px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--engr-border);
}

.engr-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.engr-section-number {
    display: inline-block;
    background: var(--engr-purple);
    color: var(--engr-white);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--engr-radius-pill);
    margin-bottom: 16px;
    letter-spacing: 0.05em;
}

.engr-section h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--engr-black);
    margin: 0 0 12px 0;
    letter-spacing: -0.01em;
}

.engr-section-intro {
    color: var(--engr-mid-gray);
    font-size: 17px;
    max-width: 700px;
    margin: 0 0 32px 0;
    line-height: 1.7;
}

.engr-section h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--engr-black);
    margin: 40px 0 20px 0;
}

.engr-section h3:first-child {
    margin-top: 0;
}

.engr-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--engr-purple);
    margin: 0 0 12px 0;
}

.engr-section p {
    color: var(--engr-mid-gray);
    margin: 0 0 16px 0;
}

.engr-section ul {
    margin: 0;
    padding-left: 24px;
    color: var(--engr-mid-gray);
}

.engr-section ul li {
    padding: 4px 0;
}

/* ============================================
   Cards
   ============================================ */
.engr-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.engr-card {
    background: var(--engr-white);
    border-radius: var(--engr-radius);
    padding: 28px;
    box-shadow: var(--engr-shadow);
    border: 1px solid var(--engr-border);
    transition: var(--engr-transition);
}

.engr-card:hover {
    box-shadow: var(--engr-shadow-lg);
}

.engr-card-dark {
    background: var(--engr-dark-gray);
    color: var(--engr-white);
    border: none;
}

.engr-card-dark p,
.engr-card-dark li {
    color: rgba(255, 255, 255, 0.75);
}

.engr-card-dark h4 {
    color: var(--engr-purple);
}

.engr-card-dark a {
    color: var(--engr-purple);
}

.engr-card-content p:last-child {
    margin-bottom: 0;
}

/* ============================================
   Color Swatches
   ============================================ */
.engr-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.engr-color-swatch {
    background: var(--engr-white);
    border-radius: var(--engr-radius);
    overflow: hidden;
    box-shadow: var(--engr-shadow);
    border: 1px solid var(--engr-border);
    transition: var(--engr-transition);
}

.engr-color-swatch:hover {
    transform: translateY(-2px);
    box-shadow: var(--engr-shadow-lg);
}

.engr-color-preview {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.engr-color-info {
    padding: 20px;
}

.engr-color-name {
    font-weight: 600;
    font-size: 17px;
    margin-bottom: 12px;
    color: var(--engr-black);
}

.engr-color-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--engr-mid-gray);
    padding: 6px 0;
}

.engr-color-value code {
    background: var(--engr-light-gray);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    color: var(--engr-black);
}

/* ============================================
   Pills / Tags
   ============================================ */
.engr-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.engr-pill {
    display: inline-block;
    padding: 10px 18px;
    background: var(--engr-white);
    border: 1px solid var(--engr-border);
    border-radius: var(--engr-radius-pill);
    font-size: 14px;
    font-weight: 500;
    color: var(--engr-black);
    transition: var(--engr-transition);
}

.engr-pill:hover {
    border-color: var(--engr-mid-gray);
}

.engr-pill-purple {
    background: var(--engr-purple-light);
    border-color: var(--engr-purple);
    color: var(--engr-purple);
}

.engr-pill-purple:hover {
    background: var(--engr-purple);
    color: var(--engr-white);
}

/* ============================================
   Tables
   ============================================ */
.engr-table-wrapper {
    overflow-x: auto;
    margin: 24px 0;
    border-radius: var(--engr-radius);
    box-shadow: var(--engr-shadow);
}

.engr-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--engr-white);
}

.engr-table th {
    background: var(--engr-purple);
    color: var(--engr-white);
    font-weight: 600;
    text-align: left;
    padding: 16px 20px;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.engr-table th:first-child {
    border-radius: var(--engr-radius) 0 0 0;
}

.engr-table th:last-child {
    border-radius: 0 var(--engr-radius) 0 0;
}

.engr-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--engr-border);
    font-size: 14px;
    color: var(--engr-mid-gray);
}

.engr-table td strong {
    color: var(--engr-black);
}

.engr-table tr:last-child td {
    border-bottom: none;
}

.engr-table tr:last-child td:first-child {
    border-radius: 0 0 0 var(--engr-radius);
}

.engr-table tr:last-child td:last-child {
    border-radius: 0 0 var(--engr-radius) 0;
}

/* ============================================
   Do's and Don'ts
   ============================================ */
.engr-dos-donts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.engr-do-item,
.engr-dont-item {
    padding: 18px 22px;
    border-radius: var(--engr-radius-sm);
    font-size: 15px;
    line-height: 1.5;
}

.engr-do-item {
    background: var(--engr-success-bg);
    border-left: 4px solid var(--engr-success);
    color: #166534;
}

.engr-dont-item {
    background: var(--engr-error-bg);
    border-left: 4px solid var(--engr-error);
    color: #991B1B;
}

.engr-do-item strong,
.engr-dont-item strong {
    display: inline;
    margin-right: 6px;
}

/* ============================================
   Logo Display
   ============================================ */
.engr-logo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin: 24px 0;
}

.engr-logo-box {
    padding: 48px 32px;
    border-radius: var(--engr-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    transition: var(--engr-transition);
}

.engr-logo-box:hover {
    transform: scale(1.02);
}

.engr-logo-box-primary,
.engr-logo-box-icon {
    background: var(--engr-dark-gray);
}

.engr-logo-box-light {
    background: var(--engr-white);
    border: 1px solid var(--engr-border);
}

.engr-logo-img {
    max-width: 200px;
    height: auto;
}

.engr-logo-label {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--engr-mid-gray);
}

.engr-logo-box-primary .engr-logo-label,
.engr-logo-box-icon .engr-logo-label {
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   Typography Samples
   ============================================ */
.engr-type-sample {
    background: var(--engr-white);
    border-radius: var(--engr-radius);
    padding: 32px;
    margin: 24px 0;
    border: 1px solid var(--engr-border);
}

.engr-type-sample-dark {
    background: var(--engr-dark-gray);
    color: var(--engr-white);
    border: none;
}

.engr-type-row {
    display: flex;
    align-items: baseline;
    padding: 18px 0;
    border-bottom: 1px solid var(--engr-border);
    flex-wrap: wrap;
    gap: 16px;
}

.engr-type-sample-dark .engr-type-row {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.engr-type-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.engr-type-row:first-child {
    padding-top: 0;
}

.engr-type-label {
    width: 120px;
    flex-shrink: 0;
    font-size: 13px;
    color: var(--engr-mid-gray);
    font-weight: 500;
}

.engr-type-sample-dark .engr-type-label {
    color: rgba(255, 255, 255, 0.5);
}

.engr-type-specs {
    width: 180px;
    flex-shrink: 0;
    font-size: 12px;
    color: #94A3B8;
}

.engr-type-sample-dark .engr-type-specs {
    color: rgba(255, 255, 255, 0.4);
}

.engr-type-preview {
    flex: 1;
    min-width: 200px;
}

/* ============================================
   Video Preview / Lower Third
   ============================================ */
.engr-video-preview {
    background: linear-gradient(135deg, var(--engr-dark-gray) 0%, #2d1f47 60%);
    border-radius: var(--engr-radius);
    padding: 100px 32px 40px;
    position: relative;
    margin: 24px 0;
    overflow: hidden;
}

.engr-video-preview::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 100%;
    background: radial-gradient(circle at 80% 20%, rgba(106, 13, 173, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

.engr-lower-third {
    display: inline-flex;
    align-items: stretch;
    position: relative;
    z-index: 1;
}

.engr-lower-third-accent {
    width: 4px;
    background: var(--engr-purple);
    border-radius: 2px;
    box-shadow: 0 0 12px var(--engr-purple);
}

.engr-lower-third-content {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    padding: 14px 28px;
    margin-left: 10px;
    border-radius: 0 6px 6px 0;
}

.engr-lower-third-name {
    color: var(--engr-white);
    font-weight: 600;
    font-size: 20px;
    letter-spacing: -0.01em;
}

.engr-lower-third-title {
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    margin-top: 2px;
}

/* ============================================
   Quick Reference
   ============================================ */
.engr-quick-ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.engr-quick-ref-label {
    display: block;
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.engr-quick-ref-value {
    display: block;
    color: var(--engr-white);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
}

/* ============================================
   Footer
   ============================================ */
.engr-footer-text {
    text-align: center;
    color: #94A3B8;
    font-size: 13px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--engr-border);
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 1024px) {
    .engr-hero {
        padding: 48px 36px;
    }
    
    .engr-hero h1 {
        font-size: 40px;
    }
    
    .engr-section h2 {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .engr-brand-guide {
        padding: 16px;
    }
    
    .engr-hero {
        padding: 36px 24px;
    }
    
    .engr-hero h1 {
        font-size: 32px;
    }
    
    .engr-hero-tagline {
        font-size: 20px;
    }
    
    .engr-section {
        margin-bottom: 48px;
        padding-bottom: 36px;
    }
    
    .engr-section h2 {
        font-size: 24px;
    }
    
    .engr-section h3 {
        font-size: 19px;
    }
    
    .engr-card {
        padding: 22px;
    }
    
    .engr-type-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .engr-type-label,
    .engr-type-specs {
        width: 100%;
    }
    
    .engr-dos-donts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .engr-hero h1 {
        font-size: 28px;
    }
    
    .engr-card-grid,
    .engr-color-grid,
    .engr-logo-grid {
        grid-template-columns: 1fr;
    }
    
    .engr-table th,
    .engr-table td {
        padding: 12px 14px;
        font-size: 13px;
    }
}

/* ============================================
   Divi Builder Compatibility
   ============================================ */
.et_pb_section .engr-brand-guide {
    max-width: 100%;
}

.et_pb_row .engr-brand-guide {
    padding: 0;
}

/* Ensure proper font rendering */
.engr-brand-guide {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Print styles */
@media print {
    .engr-brand-guide {
        max-width: 100%;
    }
    
    .engr-hero {
        background: var(--engr-dark-gray) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .engr-color-preview {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
