/* ==========================================================================
   Engineering Fundamentals Pages - Shared Styles
   For /engineering/*.html educational content pages
   ========================================================================== */

/* Main Content Wrapper */
body.engineering-page {
    padding-top: 70px; /* Account for fixed navbar */
}

.engineering-content {
    max-width: 900px;
    margin: 2rem auto 3rem auto;
    padding: 0 1.5rem;
}

/* Hero */
.eng-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 60%, #2563eb 100%);
    border-radius: 16px;
    padding: 2.25rem 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(30, 64, 175, 0.18);
}

.eng-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 10%, rgba(255,255,255,0.2), transparent 35%),
                radial-gradient(circle at 10% 30%, rgba(59,130,246,0.35), transparent 30%);
    pointer-events: none;
}

.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.35fr 0.9fr;
    gap: 1.75rem;
    align-items: start;
    z-index: 1;
}

.hero-copy h1 {
    color: #f8fafc;
    margin: 0.35rem 0 0.5rem 0;
    font-size: 2rem;
}

.eng-eyebrow {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.12);
    color: #cbd5e1;
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
}

.eng-lead {
    color: #e2e8f0;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0.5rem 0 1.25rem 0;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.eng-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0.65rem 1.2rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    font-size: 0.9375rem;
}

.eng-btn.primary {
    background: #f8fafc;
    color: #0f172a;
    box-shadow: 0 12px 25px rgba(15, 23, 42, 0.15);
}

.eng-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.2);
}

.eng-btn.ghost {
    border: 1px solid rgba(248, 250, 252, 0.35);
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}

.eng-btn.ghost:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
}

.hero-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 1.1rem;
}

.hero-meta-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    box-shadow: 0 12px 25px rgba(30, 64, 175, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.hero-meta-card h4 {
    margin: 0.15rem 0 0.25rem 0;
    color: #0f172a;
}

.hero-meta-card .muted {
    margin: 0;
    color: #475569;
}

.label {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 700;
}

.hero-sidebar {
    display: grid;
    gap: 0.75rem;
}

.toc.elevated {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #dbeafe;
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.18);
}

.hero-card {
    background: rgba(15, 23, 42, 0.75);
    color: #e2e8f0;
    border: 1px solid rgba(248, 250, 252, 0.15);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.35);
}

.hero-card h4 {
    margin: 0 0 0.5rem 0;
    color: #f8fafc;
}

.checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.4rem;
}

.checklist li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e2e8f0;
}

.checklist li::before {
    content: "•";
    color: #a5b4fc;
    font-size: 1.25rem;
    line-height: 1;
}

/* Section Cards */
.eng-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.eng-section h1 {
    color: #1e40af;
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.eng-section h2 {
    color: #1e40af;
    border-bottom: 3px solid #3b82f6;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.375rem;
}

.eng-section h3 {
    color: #1f2937;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.eng-section h4 {
    color: #374151;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.eng-section p {
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #374151;
}

.eng-section ul,
.eng-section ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
    line-height: 1.6;
}

.eng-section li {
    margin: 0.5rem 0;
    color: #374151;
}

/* Equation Boxes */
.equation-box {
    background: #f8fafc;
    border-left: 4px solid #3b82f6;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    font-family: 'Courier New', monospace;
    border-radius: 4px;
    font-size: 0.9375rem;
    line-height: 1.8;
    color: #1e293b;
}

/* Image Placeholders (for future diagrams) */
.image-placeholder {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 2px dashed #94a3b8;
    border-radius: 8px;
    padding: 2rem 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
    color: #475569;
}

.image-placeholder .img-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.image-placeholder .img-desc {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #64748b;
}

/* Illustration figures */
.eng-figure {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem;
    margin: 1.25rem 0;
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
}

.eng-figure img {
    width: 100%;       /* Full width on mobile */
    height: auto;
    display: block;
    border-radius: 10px;
}

.eng-figure figcaption {
    margin: 0.65rem 0 0 0;
    font-size: 0.9rem;
    color: #475569;
}

/* Desktop: Reduce image size for cleaner look */
@media (min-width: 768px) {
    .eng-figure img {
        width: 70%;
        max-width: 650px;
        margin: 0 auto;
    }
}

/* Callout Boxes */
.key-point {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    padding: 0.875rem 1.25rem;
    margin: 1rem 0;
    border-radius: 4px;
    font-size: 0.9375rem;
    color: #78350f;
}

.warning-box {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left: 4px solid #dc2626;
    padding: 0.875rem 1.25rem;
    margin: 0.75rem 0;
    border-radius: 4px;
    font-size: 0.9375rem;
    color: #7f1d1d;
}

.warning-box p {
    margin: 0;
    color: #7f1d1d;
}

.info-box {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 4px solid #2563eb;
    padding: 0.875rem 1.25rem;
    margin: 0.75rem 0;
    border-radius: 4px;
    font-size: 0.9375rem;
    color: #1e3a8a;
}

.quick-ref {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
}

.quick-ref h4 {
    margin: 0 0 0.5rem 0;
    color: #166534;
    font-size: 0.9375rem;
}

.quick-ref p {
    margin: 0;
    color: #166534;
}

/* Calculator Link Boxes */
.calc-link-box {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #3b82f6;
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    text-align: center;
}

.calc-link-box p {
    margin: 0 0 0.25rem 0;
    color: #1e3a8a;
}

.calc-link-box a {
    display: inline-block;
    background: #2563eb;
    color: white;
    padding: 0.625rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 0.25rem;
    transition: background 0.2s;
    font-size: 0.9375rem;
}

.calc-link-box a:hover {
    background: #1d4ed8;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.data-table th {
    background: #f3f4f6;
    border-bottom: 2px solid #d1d5db;
    padding: 0.625rem;
    text-align: left;
    font-weight: 600;
    color: #1f2937;
}

.data-table td {
    padding: 0.625rem;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

.data-table tr:hover {
    background: #f9fafb;
}

/* Table of Contents */
.toc {
    background: #f8fafc;
    border-radius: 6px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 3px solid #3b82f6;
}

.toc h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9375rem;
    color: #1e40af;
    font-weight: 600;
}

.toc ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.toc li {
    margin: 0.5rem 0;
}

.toc a {
    color: #1f2937;
    text-decoration: none;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    font-weight: 500;
}

.toc a:hover {
    background: #e0f2fe;
    color: #1e40af;
    transform: translateX(4px);
}

.toc a::before {
    content: "→";
    margin-right: 0.5rem;
    color: #3b82f6;
    font-weight: 600;
}

/* Example/Code Blocks */
.example-block {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.9375rem;
}

.example-block p {
    margin: 0.5rem 0;
}

.code-block {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 0.75rem;
    border-radius: 4px;
    margin: 0.5rem 0;
}

/* Related Links Section */
.related-links {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid #e5e7eb;
}

.related-links h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.125rem;
    color: #1e40af;
    font-weight: 600;
}

.related-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

.related-links li {
    margin: 0;
}

.related-links a {
    color: #1f2937;
    text-decoration: none;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
    font-weight: 500;
}

.related-links a:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1e40af;
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.related-links a::before {
    content: "→";
    margin-right: 0.75rem;
    color: #3b82f6;
    font-weight: 600;
    font-size: 1rem;
}

/* Modern card layouts */
.eng-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.eng-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.eng-card h4 {
    margin: 0.1rem 0 0.35rem 0;
    color: #0f172a;
}

.eng-card .muted {
    margin: 0;
    color: #475569;
    line-height: 1.5;
}

.eng-quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.9rem;
    margin: 1.25rem 0 0.25rem 0;
}

.stat-card {
    background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.95rem 1.1rem;
    box-shadow: 0 12px 22px rgba(148, 163, 184, 0.15);
}

.stat-card h4 {
    margin: 0.1rem 0 0.3rem 0;
    color: #1e293b;
}

.stat-card .muted {
    margin: 0;
    color: #475569;
}

/* Stepper */
.eng-stepper {
    border-left: 3px solid #3b82f6;
    padding-left: 1rem;
    display: grid;
    gap: 0.65rem;
    margin: 1.25rem 0;
}

.eng-step {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.07);
}

.eng-step p {
    margin: 0.25rem 0 0 0;
    color: #111827;
    line-height: 1.5;
}

.step-tag {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    background: #e0f2fe;
    color: #0f172a;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

/* Safety band */
.safety-band {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin: 1.25rem 0 0.5rem 0;
}

.safety-band .band {
    border-radius: 12px;
    padding: 0.9rem 1rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.safety-band .band strong {
    display: block;
    margin: 0.15rem 0;
}

.safety-band .band .muted {
    margin: 0;
    color: #475569;
}

.safety-band .lean {
    background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
}

.safety-band .window {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.safety-band .rich {
    background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body.engineering-page {
        padding-top: 60px;
    }

    .engineering-content {
        margin: 1rem auto 2rem auto;
        padding: 0 1rem;
    }

    .eng-hero {
        padding: 1.5rem 1.25rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-sidebar {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        flex-direction: column;
    }

    .eng-btn {
        width: 100%;
    }

    .eng-section {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }

    .eng-section h1 {
        font-size: 1.5rem;
    }

    .eng-section h2 {
        font-size: 1.25rem;
    }

    .eng-section h3 {
        font-size: 1rem;
    }

    .equation-box,
    .key-point,
    .warning-box,
    .info-box {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .image-placeholder {
        padding: 1.5rem 1rem;
    }

    .data-table {
        font-size: 0.8125rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem 0.375rem;
    }
}

/* Print Styles */
@media print {
    body.engineering-page {
        padding-top: 0;
    }

    .calc-link-box,
    .related-links {
        display: none;
    }

    .eng-section {
        box-shadow: none;
        page-break-inside: avoid;
    }
}
