/*
* Rigel Design Services - Professional Enhancements
* Ensuring perfect alignment, typography, and presentation for investors
* Version: 1.0.0
*/

/* ==========================================================================
   Image Enhancements & Alignment
   ========================================================================== */

/* Consistent Image Sizing and Display */
.service-image,
.story-image img,
.featured-story-image img,
.testimonial-author img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Service Images - Consistent Height */
.service-image-container {
    width: 100%;
    min-height: 400px;
    max-height: 500px;
    overflow: hidden;
    position: relative;
}

.service-image {
    width: 100%;
    height: 100%;
    min-height: 400px;
    object-fit: cover;
    object-position: center;
}

/* Image Loading States */
.service-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,107,0,0.1) 0%, rgba(26,26,26,0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.service-image-container:hover::after {
    opacity: 1;
}

/* Ensure Images Don't Break Layout */
img {
    max-width: 100%;
    height: auto;
    display: block;
    border-style: none;
}

/* ==========================================================================
   Typography Enhancements
   ========================================================================== */

/* Consistent Font Weights */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

/* Paragraph Spacing */
p {
    margin-top: 0;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

/* Service Titles - Consistent Sizing */
.service-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.2;
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Service Descriptions - Better Readability */
.service-description {
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2rem;
}

/* ==========================================================================
   Feature List Items - Unified Checkmark Styling Across All Pages
   ========================================================================== */

/* Standard checkmark for ul.feature-list li (mechanical, electronic, fabrication) */
ul.feature-list li,
.feature-list li {
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    position: relative;
    padding-left: 2.25rem;
    color: rgba(255, 255, 255, 0.9);
    list-style: none;
}

ul.feature-list li::before,
.feature-list li::before {
    content: "✓" !important;
    color: var(--primary-color) !important;
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
    font-size: 1rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 107, 0, 0.15);
    border-radius: 4px;
    transition: all 0.3s ease;
    line-height: 1;
    margin-top: 0.1rem;
}

ul.feature-list li:hover::before,
.feature-list li:hover::before {
    background: rgba(255, 107, 0, 0.25);
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3);
}

/* Standard checkmark for div.feature-list .feature-item (digital, design, packaging) */
.feature-list .feature-item,
.feature-item {
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    position: relative;
    padding-left: 2.25rem;
    color: rgba(255, 255, 255, 0.9);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.feature-list .feature-item::before,
.feature-item::before {
    content: "✓" !important;
    color: var(--primary-color) !important;
    position: absolute;
    left: 0;
    top: 0.5rem;
    font-weight: 700;
    font-size: 1rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 107, 0, 0.15);
    border-radius: 4px;
    transition: all 0.3s ease;
    line-height: 1;
}

.feature-list .feature-item:hover::before,
.feature-item:hover::before {
    background: rgba(255, 107, 0, 0.25);
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3);
}

/* Strong override for any conflicting checkmark styles */
.feature-item::before,
.feature-list li::before {
    content: "✓" !important;
    background: rgba(255, 107, 0, 0.15) !important;
    border-radius: 4px !important;
    width: 1.5rem !important;
    height: 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--primary-color) !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
}

/* Industries page checkmarks */
.solution-features li i.fa-check-circle {
    color: var(--primary-color) !important;
    font-size: 0.95rem !important;
    margin-right: 0.75rem !important;
    background: rgba(255, 107, 0, 0.15) !important;
    width: 1.5rem !important;
    height: 1.5rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    transition: all 0.3s ease;
    padding: 0 !important;
}

.solution-features li:hover i.fa-check-circle {
    background: rgba(255, 107, 0, 0.25) !important;
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3);
}

/* Packaging page specific */
.packaging .feature-list li::before {
    content: "✓" !important;
    color: var(--primary-color) !important;
    background: rgba(255, 107, 0, 0.15) !important;
    border-radius: 4px !important;
    width: 1.5rem !important;
    height: 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    left: 0 !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
}

.packaging .feature-list li:hover::before {
    background: rgba(255, 107, 0, 0.25) !important;
    transform: scale(1.15) !important;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3) !important;
}

/* ==========================================================================
   Layout & Spacing Enhancements
   ========================================================================== */

/* Consistent Container Padding */
.container {
    padding-left: clamp(1rem, 4vw, 2rem);
    padding-right: clamp(1rem, 4vw, 2rem);
}

/* Service Section Spacing */
.service-section {
    padding: clamp(3rem, 8vw, 5rem) 0;
}

.service-content {
    gap: clamp(2rem, 5vw, 4rem);
    padding: 0 clamp(1rem, 4vw, 2rem);
}

/* Grid Gap Consistency */
.services-grid,
.story-grid,
.testimonial-grid,
.industry-cards {
    gap: clamp(1.5rem, 3vw, 2.5rem);
}

/* ==========================================================================
   Alignment Fixes
   ========================================================================== */

/* Text Alignment */
.section-title,
.service-hero h1,
.contact-hero h1 {
    text-align: center;
}

/* Service Details Alignment */
.service-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Image Container Alignment */
.service-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Center Align Content in Cards */
.service-card,
.story-card,
.testimonial-card,
.industry-card {
    text-align: left;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Responsive Image Sizing
   ========================================================================== */

@media (max-width: 1024px) {
    .service-image {
        min-height: 350px;
    }
    
    .service-image-container {
        min-height: 350px;
        max-height: 450px;
    }
}

@media (max-width: 768px) {
    .service-image {
        min-height: 300px;
    }
    
    .service-image-container {
        min-height: 300px;
        max-height: 400px;
    }
    
    .service-content {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }
    
    /* Ensure proper image order on mobile */
    .service-content:nth-child(even) {
        direction: ltr;
    }
    
    .service-content > * {
        direction: ltr;
    }
}

@media (max-width: 480px) {
    .service-image {
        min-height: 250px;
    }
    
    .service-image-container {
        min-height: 250px;
        max-height: 350px;
    }
}

/* ==========================================================================
   Success Stories Image Enhancements
   ========================================================================== */

.story-image {
    height: clamp(200px, 25vw, 250px);
    overflow: hidden;
    position: relative;
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.featured-story-image {
    min-height: clamp(300px, 40vw, 450px);
    position: relative;
}

.featured-story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Testimonial Images */
.author-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.author-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   Contact Page Enhancements
   ========================================================================== */

.map-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.map-iframe {
    width: 100%;
    height: 450px;
    border: 0;
    display: block;
}

@media (max-width: 768px) {
    .map-iframe {
        height: 350px;
    }
}

/* Contact Cards */
.contact-card {
    width: 100%;
    max-width: 380px;
    min-width: 350px;
    margin: 0 auto;
}

.contact-cards {
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(1.5rem, 3vw, 2rem);
}

/* ==========================================================================
   Font Consistency
   ========================================================================== */

/* Ensure All Text Uses Primary Font */
body,
p,
span,
li,
label,
input,
textarea,
select {
    font-family: var(--font-primary);
}

/* Heading Font Consistency */
h1, h2, h3, h4, h5, h6,
.section-title,
.service-title,
.hero h1 {
    font-family: var(--font-heading);
}

/* ==========================================================================
   Professional Polish
   ========================================================================== */

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Better Focus States */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Consistent Button Sizing */
.cta-button,
.purchase-btn,
.submit-btn {
    min-height: 48px;
    padding: clamp(0.875rem, 2vw, 1.25rem) clamp(2rem, 4vw, 3rem);
    font-size: clamp(0.95rem, 2vw, 1.1rem);
}

/* Consistent Border Radius */
.service-image-container,
.service-card,
.story-card,
.testimonial-card,
.industry-card,
.form-container {
    border-radius: clamp(12px, 2vw, 16px);
}

/* ==========================================================================
   Loading & Performance
   ========================================================================== */

/* Image Loading Optimization */
img {
    loading: lazy;
    decoding: async;
}

/* Prevent Layout Shift */
.service-image-container,
.story-image,
.featured-story-image {
    aspect-ratio: 16 / 9;
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

/* Better Contrast for Text */
.service-description,
.story-excerpt,
.contact-card p {
    color: rgba(255, 255, 255, 0.85);
}

/* Focus Visible States */
.cta-button:focus-visible,
.purchase-btn:focus-visible,
.submit-btn:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

/* ==========================================================================
   Print Styles (for PDF exports to investors)
   ========================================================================== */

@media print {
    .navbar,
    .menu-toggle,
    .cta-button,
    .purchase-btn {
        display: none;
    }
    
    .service-image-container,
    .story-image {
        page-break-inside: avoid;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* ==========================================================================
   High-DPI Display Optimizations
   ========================================================================== */

@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    .service-image,
    .story-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ==========================================================================
   Animation Performance
   ========================================================================== */

.service-image-container,
.service-image,
.story-card,
.testimonial-card {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ==========================================================================
   Final Polish - Spacing Consistency
   ========================================================================== */

/* Section Spacing */
section {
    padding: clamp(3rem, 8vw, 6rem) 0;
}

/* Container Max Width Consistency */
.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Service Content Max Width */
.service-content {
    max-width: 1400px;
}

/* ==========================================================================
   Success Stories Grid Fixes
   ========================================================================== */

.story-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media (max-width: 992px) {
    .story-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .story-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Industries Page Enhancements
   ========================================================================== */

.industry-cards {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.industry-card {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ==========================================================================
   Form Enhancements
   ========================================================================== */

.form-control {
    font-size: 1rem;
    line-height: 1.5;
    padding: 1rem 1.25rem;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* ==========================================================================
   Footer Consistency
   ========================================================================== */

.footer-content {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem);
}

/* ==========================================================================
   Hero Section Polish
   ========================================================================== */

.hero-content h1 {
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.subtitle h2 {
    line-height: 1.5;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   Service Hero Enhancements
   ========================================================================== */

.service-hero {
    padding: clamp(4rem, 10vw, 8rem) 0;
}

.service-hero h1 {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    margin-bottom: 1.5rem;
}

.service-intro {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    max-width: 800px;
    margin: 0 auto;
}

