/**
 * Page Template: Service Area
 * Mobile-first responsive design
 */

:root {
    --primary-red: #ff2400;
    --secondary-black: #000000;
    --text-gray: #333333;
    --light-gray: #f5f5f5;
    --bg-gray: #f8f8f8;
    --font-primary: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

/* Main Container */
.metal-america-service-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow-x: hidden;
}

/* Container styling to match careers page */
.metal-america-service-container .container,
.careers-stay-connected .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* HERO SECTION */
.service-hero-section {
    position: relative;
    width: 100%;
    aspect-ratio: 4/1; /* Maintain 4:1 ratio on all screen sizes */
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    max-width: 1200px;
    margin: 0 auto;
}

.service-hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.service-hero-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.service-hero-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 2;
    width: calc(100% - 40px); /* Prevent overflow on mobile */
    box-sizing: border-box;
    text-align: right; /* Right align button on mobile */
}

.our-story-button {
    display: inline-block;
    padding: 10px 19px; /* 20% smaller than 12px 24px */
    background-color: var(--primary-red);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px; /* 20% smaller than 16px */
    border-radius: 4px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid var(--primary-red);
}

.our-story-button:hover {
    background-color: transparent;
    color: var(--primary-red);
    border-color: var(--primary-red);
}

/* SERVICE AREA SECTION */
.service-area-section {
    padding: 40px 0;
    background-color: white;
    width: 100%;
}

.service-area-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px; /* Reduced padding to prevent mobile overflow */
    box-sizing: border-box;
}

.service-area-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

/* Left Side - Text Content */
.service-area-text {
    width: 100%;
    text-align: left; /* Left align text content */
    max-width: 600px; /* Constrain width for centering */
    margin: 0 auto; /* Center the container */
}

.flag-container {
    margin-bottom: 20px;
}

/* Mobile and tablet: show mobile flag, hide desktop flag */
.flag-mobile {
    display: block;
}

.flag-desktop {
    display: none;
}

/* Force hide desktop flag and its contents on mobile and tablet */
@media (max-width: 991px) {
    .flag-desktop,
    .flag-desktop .usa-flag-icon,
    .flag-container.flag-desktop,
    .flag-container.flag-desktop .usa-flag-icon {
        display: none;
        visibility: hidden;
        opacity: 0;
        width: 0;
        height: 0;
        overflow: hidden;
    }
    
    /* Hide mobile flag on mobile and tablet */
    .flag-mobile,
    .flag-mobile .usa-flag-icon,
    .flag-container.flag-mobile,
    .flag-container.flag-mobile .usa-flag-icon {
        display: none;
    }
}

.usa-flag-icon {
    width: 40px;
    height: auto;
    display: inline-block;
}

.service-area-title {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary-black);
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.service-area-description {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-gray);
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Right Side - Map */
.service-area-map {
    width: 100%;
    display: flex;
    justify-content: center;
}

.map-container {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1/1; /* Maintain 1:1 ratio on all screen sizes */
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.map-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* DID YOU KNOW BANNER */
.did-you-know-banner {
    background-color: var(--primary-red);
    padding: 12px 0; /* 20% shorter than 15px */
    text-align: center;
}

.banner-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.banner-text {
    color: white;
    font-family: var(--font-primary);
    font-size: 0.96rem; /* 20% smaller than 1.2rem */
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* FEATURED PUBLICATIONS SECTION - styles in publications-grid.css */

/* LATEST POSTS SECTION (copied from page-garages-shops.css) */
.latest-posts-section {
    background: #000000;
    padding: 40px 0 50px 0;
    margin-top: 0;
    width: 100%;
}

.latest-posts-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-heading {
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 30px 0;
    text-align: left;
}

/* Mobile: Single column grid for latest posts */
.latest-posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

/* Latest Post Card Styles */
.latest-post-card {
    background: #ffffff;
    border: 1px solid #ffffff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.latest-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.card-image {
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #f5f5f5;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    opacity: 1; /* Show images immediately */
}

.card-link:hover .card-image img {
    transform: scale(1.05);
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.placeholder-image::after {
    content: "📷";
    font-size: 2rem;
    color: #999;
}

.card-category {
    background: var(--primary-red);
    color: #ffffff;
    padding: 8px 15px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.card-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.card-date {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
    margin: 0 0 10px 0;
    text-align: left;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* TABLET STYLES (576px and up) */
@media (min-width: 576px) {
    .service-area-container {
        padding: 0 30px;
    }
    
    .our-story-button {
        padding: 12px 24px; /* 20% smaller than 15px 30px */
        font-size: 14px; /* 20% smaller than 18px */
    }
    
    .service-area-title {
        font-size: 2.2rem;
    }
    
    .service-area-description {
        font-size: 1.1rem;
    }
    
    .banner-text {
        font-size: 1.12rem; /* 20% smaller than 1.4rem */
    }
    
    /* Two columns for latest posts on tablet */
    .latest-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .section-heading {
        font-size: 2rem;
    }
}

/* LARGE TABLET STYLES (768px and up) */
@media (min-width: 768px) {
    .service-hero-overlay {
        bottom: 30px;
        left: 30px;
        text-align: left; /* Left align button on tablet and up */
    }
    
    .service-area-section {
        padding: 60px 0;
    }
    
    .map-container {
        max-width: 500px;
    }
    
    .latest-posts-container {
        padding: 0 40px;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    .careers-stay-connected {
        padding: 100px 0;
    }
}

/* DESKTOP STYLES (992px and up) */
@media (min-width: 992px) {
    .service-hero-overlay {
        bottom: 40px;
        left: 40px;
    }
    
    .service-area-section {
        padding: 80px 0;
    }
    
    .service-area-container {
        padding: 0 40px;
    }
    
    /* Desktop: reduce container padding to give content more room */
    .service-area-container {
        padding: 0 7.5px; /* Half of mobile padding for more room */
    }
    
    /* Two column layout for service area */
    .service-area-content {
        flex-direction: row;
        gap: 60px;
        align-items: stretch; /* Make both columns same height */
    }
    
    .service-area-text {
        width: 50%;
        text-align: left;
        max-width: none; /* Remove max-width constraint on desktop */
        margin: 0; /* Remove auto margin on desktop */
        display: flex;
        flex-direction: column;
    }
    
    /* Desktop flag positioning */
    .flag-mobile {
        display: none; /* Hide mobile flag on desktop */
    }
    
    .flag-desktop {
        display: block !important; /* Show desktop flag */
        margin-top: auto; /* Push flag to bottom */
        margin-bottom: 0; /* Remove bottom margin */
        align-self: flex-start; /* Align flag to left */
    }
    
    .flag-desktop .usa-flag-icon {
        width: 160px; /* 4x bigger than 40px */
        height: auto;
    }
    
    .service-area-map {
        width: 50%;
        justify-content: flex-end;
        display: flex;
        align-items: stretch; /* Make map container stretch to match text height */
    }
    
    .map-container {
        max-width: 600px;
    }
    
    .service-area-title {
        font-size: 2.5rem;
    }
    
    .service-area-description {
        font-size: 1.2rem;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }
    
    .banner-text {
        font-size: 1.28rem; /* 20% smaller than 1.6rem */
    }
    
    /* Four columns for latest posts on desktop */
    .latest-posts-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
    
    .section-heading {
        font-size: 2.2rem;
        margin-bottom: 40px;
    }
    
    .latest-posts-section {
        padding: 60px 0;
    }
}

/* LARGE DESKTOP STYLES (1200px and up) */
@media (min-width: 1200px) {
    .service-hero-overlay {
        bottom: 50px;
        left: 50px;
    }
    
    .our-story-button {
        padding: 14px 29px; /* 20% smaller than 18px 36px */
        font-size: 16px; /* 20% smaller than 20px */
    }
    
    .service-area-section {
        padding: 100px 0;
    }
    
    .service-area-content {
        gap: 80px;
    }
    
    .service-area-title {
        font-size: 3rem;
        margin-bottom: 30px;
    }
    
    .service-area-description {
        font-size: 1.3rem;
    }
    
    .latest-posts-container {
        padding: 0 60px;
    }
    
    .card-title {
        font-size: 1.3rem;
    }
    
    .section-heading {
        font-size: 2.5rem;
    }
    
    .banner-text {
        font-size: 1.44rem; /* 20% smaller than 1.8rem */
    }
    
    .careers-stay-connected-title {
        font-size: 3rem;
    }
}

/* PUBLICATIONS RESPONSIVE - styles in publications-grid.css */

/* ACCESSIBILITY AND FOCUS STATES */
.our-story-button:focus,
.card-link:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

/* PRINT STYLES */
@media print {
    .latest-posts-section {
        background: #fff !important;
        color: #000 !important;
    }
    
    .section-heading {
        color: #000 !important;
    }
    
    .card-category {
        background: #000 !important;
        color: #fff !important;
    }
    
    .did-you-know-banner {
        background: #000 !important;
    }
}

/* ========================================
   STAY CONNECTED SECTION
======================================== */
.careers-stay-connected {
    position: relative;
    padding: 100px 0;
    overflow: hidden;
}

.careers-stay-connected-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.careers-stay-connected-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: high-quality;
    image-rendering: -webkit-optimize-contrast;
    -ms-interpolation-mode: bicubic;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.careers-stay-connected-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    z-index: 2;
}

.careers-stay-connected-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: #ffffff;
}

.careers-stay-connected-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 30px 0;
    color: #ffffff;
}

.careers-stay-connected-button {
    display: inline-block;
    background: #ff2400;
    color: #ffffff;
    padding: 15px 30px;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.careers-stay-connected-button:hover {
    background: #d61d00;
    transform: translateY(-3px);
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(255, 36, 0, 0.4);
}

/* Stay Connected Mobile Styles (match careers page exactly) */
@media (max-width: 768px) {
    .careers-stay-connected {
        padding: 40px 0;
    }
    
    .careers-stay-connected-background img {
        object-fit: cover;
        object-position: center center;
    }
    
    .careers-stay-connected-title {
        font-size: 2rem;
    }
} 