/* ================================================
   PROJECTS PAGES
   Main listing + PSI + OHE detail pages
   ================================================ */

.projects-page {
    padding: 7em 0;
    background-color: #F5F4F5;
}

/* Projects / PSI / OHE banner now inherits the shared .page-banner
   component in layout.css (image + overlay + 320px + white 42px title).
   The .page-banner--projects class remains in the markup but needs no
   extra rules. */

/* ------------------------------------------------
   Two-column layout (left intro + right cards)
   ------------------------------------------------ */
/* Original: left (text+video) 572px, right (cards) 698px within 1280 inner.
   Columns are equal-height and top-aligned (stretch), not centered. */
.projects-two-col {
    display: grid;
    grid-template-columns: 572fr 698fr;
    gap: 24px;
    align-items: stretch;
}

.projects-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    /* Original insets content ~48px on the right so the video (~508px) and
       heading don't run up against the info cards. */
    padding-right: 48px;
}

.projects-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.projects-subtitle h6 {
    margin-bottom: 0;
}

.projects-intro-block h2 {
    font-family: var(--font-primary);
    font-size: var(--h2-size);
    font-weight: var(--h2-weight);
    line-height: var(--h2-line-height);
    letter-spacing: var(--h2-letter-spacing);
    color: var(--color-dark-heading);
    margin-bottom: 16px;
}

.projects-intro-block p {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6em;
    color: var(--color-body);
    margin-bottom: 12px;
}

/* Fixed 16:9 box so the video never resizes when it loads/plays
   (height:auto caused a layout shift/expansion on play) */
.projects-hero-media {
    margin: 0;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #000;
}

.projects-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Right column: 3 equal-height stacked cards (grid rows) to mirror the
   original where all three cards share one height and fill the column. */
.projects-right {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    gap: 20px;
}

/* Original card: white, 32px padding, soft wide shadow, no border/radius */
.projects-summary-card {
    background: #FFFFFF;
    border: none;
    border-radius: 0;
    padding: 32px;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.projects-summary-card:hover {
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.16);
    transform: translateY(-2px);
}

.projects-summary-card h5 {
    font-family: var(--font-primary);
    font-size: var(--h5-size);
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--color-dark-heading);
    margin-bottom: 8px;
}

.projects-summary-card p {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5em;
    color: var(--color-body);
    margin-bottom: 0;
}

/* ------------------------------------------------
   Our Notable Projects - overlay cards
   ------------------------------------------------ */
.projects-notable {
    padding: 5em 0;
}

.notable-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 36px;
}

.notable-header h2 {
    font-family: var(--font-primary);
    font-size: var(--h2-size);
    font-weight: var(--h2-weight);
    line-height: var(--h2-line-height);
    letter-spacing: var(--h2-letter-spacing);
    color: var(--color-dark-heading);
    margin-bottom: 0;
}

.notable-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.notable-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 2;
}

.notable-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

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

/* Dark gradient overlay on image */
.notable-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 60%, rgba(0, 0, 0, 0.15) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 28px;
}

.notable-card-overlay h2 {
    font-family: var(--font-primary);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2em;
    color: #FFFFFF;
    margin-bottom: 8px;
}

.notable-card-overlay p {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5em;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 16px;
}

/* ------------------------------------------------
   CTA Section - dark background with image
   ------------------------------------------------ */
.projects-cta {
    position: relative;
    padding: 7em 0;
    background-color: #0A0B14;
    background-image: url('../images/cta-banner.jpg');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    overflow: hidden;
}

.projects-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10, 11, 20, 0.92) 0%, rgba(10, 11, 20, 0.6) 100%);
    pointer-events: none;
}

.projects-cta .container {
    position: relative;
    z-index: 1;
}

.projects-cta-inner {
    max-width: 500px;
}

.projects-cta-inner h2 {
    font-family: var(--font-primary);
    font-size: 42px;
    font-weight: 700;
    line-height: 1.1em;
    letter-spacing: -1.5px;
    color: #FFFFFF;
    margin-bottom: 16px;
}

.projects-cta-inner p {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 24px;
}

/* ------------------------------------------------
   Responsive
   ------------------------------------------------ */
@media (max-width: 1024px) {
    .projects-page {
        padding: 4em 0;
    }

    /* Tablet keeps the 2-column layout (like the original); just tighten the
       inset and gap so the columns fit comfortably. */
    .projects-two-col {
        gap: 20px;
    }

    .projects-left {
        padding-right: 24px;
    }

    .projects-notable {
        padding: 3em 0;
    }

    .projects-cta {
        padding: 4em 0;
    }

    .projects-cta-inner h2 {
        font-size: 34px;
    }
}

@media (max-width: 767px) {
    .projects-page {
        padding: 2em 0;
    }

    /* Mobile: stack the two columns (matches original's 767px collapse) */
    .projects-two-col {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .projects-left {
        padding-right: 0;
    }

    .projects-right {
        grid-template-rows: none;
    }

    .notable-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .notable-card-overlay {
        padding: 20px;
    }

    .notable-card-overlay h2 {
        font-size: 26px;
    }

    .projects-cta {
        padding: 3em 0;
    }

    .projects-cta-inner {
        max-width: 100%;
    }

    .projects-cta-inner h2 {
        font-size: 26px;
    }

    .projects-summary-card {
        padding: 22px 20px;
    }
}

/* ------------------------------------------------
   PSI / OHE detail pages
   ------------------------------------------------ */
.project-detail-section {
    padding: 5em 0;
}

/* KEY POINTS - EAE-style center timeline
   Line 3px centered; circle icon nodes (red, white bolt);
   cards alternate around the spine. */
.key-points-timeline {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    padding: 10px 0;
}

/* center spine: 3px, yellow track like the original (#FCDB00) */
.key-points-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(50% - 1.5px);
    width: 3px;
    background: #FCDB00;
}

.kp-item {
    position: relative;
    width: 50%;
    padding: 18px 46px;
    box-sizing: border-box;
    min-height: 78px;
}

.kp-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.kp-item:nth-child(even) {
    left: 50%;
    text-align: left;
}

/* circle node on the spine */
.kp-item::after {
    content: '';
    position: absolute;
    top: 22px;
    width: 38px;
    height: 38px;
    background: #CE1E0D;
    border-radius: 50%;
    border: 3px solid #FFFFFF;
    box-shadow: 0 0 0 3px #FCDB00;
    /* bolt glyph centered in the node */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512' width='16' height='16' fill='%23fff'%3E%3Cpath d='M296 160H180.6l42.6-129.8C227.2 15 215.7 0 200 0H56C44 0 33.8 8.9 32.2 20.8l-32 240C-1.7 275.2 9.5 288 24 288h118.7L96.6 482.5c-3.6 15.2 8 29.5 23.3 29.5 8.4 0 16.4-4.4 20.8-12l176-304c9.3-15.9-2.2-36-20.7-36z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.kp-item:nth-child(odd)::after {
    right: -19px;
}

.kp-item:nth-child(even)::after {
    left: -19px;
}

.kp-card {
    background: #FFFFFF;
    border-bottom: 4px solid var(--color-border);
    box-shadow: 0px 4px 24px rgba(0, 0, 0, 0.07);
    padding: 20px 24px;
    transition: border-color 0.4s ease, transform 0.3s ease;
}

.kp-card:hover {
    border-bottom-color: #D31F0D;
    transform: translateY(-3px);
}

.kp-label {
    display: inline-block;
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #D31F0D;
    margin-bottom: 6px;
}

.kp-card p {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5em;
    color: var(--color-body);
    margin-bottom: 0;
}

/* ORDERS EXECUTED - alternating zig-zag rows */
.orders-section {
    padding: 4.5em 0;
    background-color: #F5F4F5;
}

.orders-section h2 {
    font-family: var(--font-primary);
    font-size: var(--h2-size);
    font-weight: var(--h2-weight);
    line-height: var(--h2-line-height);
    letter-spacing: var(--h2-letter-spacing);
    color: var(--color-dark-heading);
    text-align: center;
    margin-bottom: 44px;
}

.orders-zigzag {
    display: flex;
    flex-direction: column;
    gap: 44px;
}

.order-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 40px;
}

/* even rows: image on the left, text on the right */
.order-row:nth-child(even) .order-text {
    order: 2;
}

.order-row:nth-child(even) .order-media {
    order: 1;
}

.order-text h3 {
    font-family: var(--font-primary);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3em;
    letter-spacing: -0.5px;
    color: var(--color-dark-heading);
    margin-bottom: 4px;
}

.order-text h4,
.order-subtitle {
    font-family: var(--font-primary);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4em;
    color: #CE1E0D;
    margin-bottom: 10px;
}

.order-text p {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6em;
    color: var(--color-body);
    margin-bottom: 8px;
}

.order-text ul {
    list-style: disc;
    padding-left: 20px;
    margin: 8px 0 0;
}

.order-text ul li {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5em;
    color: var(--color-body);
    margin-bottom: 4px;
}

.order-media {
    overflow: hidden;
    aspect-ratio: 3 / 2;
}

.order-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.order-row:hover .order-media img {
    transform: scale(1.04);
}

/* Railway clients section */
.railway-clients {
    padding: 4em 0;
    background-color: #FFFFFF;
}

.railway-clients h2 {
    font-family: var(--font-primary);
    font-size: var(--h2-size);
    font-weight: var(--h2-weight);
    text-align: center;
    margin-bottom: 32px;
}

.railway-clients-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.railway-client-logo {
    width: 160px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    padding: 8px;
    border: none;
}

.railway-client-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain !important;
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 1024px) {
    .projects-page,
    .project-detail-section {
        padding: 3em 0 4em;
    }

    /* Orders zig-zag: keep image/text side-by-side but tighter */
    .order-row {
        gap: 28px;
    }
}

@media (max-width: 767px) {
    .projects-page,
    .project-detail-section {
        padding: 2em 0 3em;
    }

    /* Key points timeline: collapse to single column, spine on the left */
    .key-points-timeline::before {
        left: 18px;
    }

    .kp-item {
        width: 100%;
        left: 0 !important;
        padding: 10px 0 10px 56px;
        text-align: left !important;
        min-height: 0;
    }

    .kp-item::after {
        left: 0 !important;
        right: auto !important;
        top: 16px;
    }

    /* Orders zig-zag: stack image above text, image always first */
    .order-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .order-row .order-text,
    .order-row:nth-child(even) .order-text {
        order: 2;
    }

    .order-row .order-media,
    .order-row:nth-child(even) .order-media {
        order: 1;
    }

    .order-text h3 {
        font-size: 20px;
    }

    .railway-client-logo {
        width: 120px;
        height: 80px;
    }
}

/* ------------------------------------------------
   Project Gallery (PSI / OHE) - Swiper image slider
   ------------------------------------------------ */
.project-gallery {
    padding: 4.5em 0;
}

.project-gallery-swiper {
    position: relative;
    padding: 8px 0 44px;
}

.project-gallery-swiper .swiper-slide {
    overflow: hidden;
}

.project-gallery-swiper .swiper-slide img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-gallery-swiper .swiper-slide:hover img {
    transform: scale(1.04);
}

/* Red circular nav buttons like the brand accent */
.project-gallery-swiper .swiper-button-prev,
.project-gallery-swiper .swiper-button-next {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #D31F0D;
    color: #FFFFFF;
    margin-top: -22px;
    transition: background 0.3s ease;
}

.project-gallery-swiper .swiper-button-prev:hover,
.project-gallery-swiper .swiper-button-next:hover {
    background: #B51717;
}

.project-gallery-swiper .swiper-button-prev::after,
.project-gallery-swiper .swiper-button-next::after {
    font-size: 16px;
    font-weight: 700;
}

.project-gallery-swiper .swiper-pagination {
    bottom: 8px;
}

.project-gallery-swiper .swiper-pagination-bullet-active {
    background: #D31F0D;
}

/* ------------------------------------------------
   Railway Clients Swiper carousel (PSI / OHE)
   ------------------------------------------------ */
.railway-swiper-wrap {
    padding: 40px 50px;
}

.railway-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
}

.railway-swiper .swiper-slide img {
    max-width: 100%;
    height: 100px;
    object-fit: contain !important;
}

.railway-swiper .swiper-button-prev,
.railway-swiper .swiper-button-next {
    width: 34px;
    height: 34px;
    color: #D31F0D;
}

.railway-swiper .swiper-button-prev::after,
.railway-swiper .swiper-button-next::after {
    font-size: 22px;
    font-weight: 700;
}

.railway-pagination {
    text-align: center;
    padding-top: 20px;
}

.railway-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #DCDCDE;
    opacity: 1;
    margin: 0 3px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
}

.railway-pagination .swiper-pagination-bullet-active {
    background: #D31F0D;
}

@media (max-width: 767px) {
    .railway-swiper-wrap {
        padding: 24px 0;
    }

    .railway-swiper .swiper-slide img {
        height: 60px;
    }
}
