/* =====================================================
   PROJECTS PAGE CSS - CLEAN RESPONSIVE VERSION
   Fixes mobile project card unequal spacing/alignment
   ===================================================== */

/* ── RESET ── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

[style*="font-family: 'orlean'"] {
    letter-spacing: 0.9px !important;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.vertex-project-tab-btn.active .word-1 {
    color: #9b6948;
    font-family: 'orlean';
}

.vertex-project-tab-btn.active .word-2 {
    color: #6d92c1;
    font-family: 'orlean';
}

/* ── CONTAINER ── */
.projects-section,
.vertex-project-tab-content-wrap,
.vertex-project-tab-pane {
    width: 100%;
    max-width: 100%;
}

.projects-section .container {
    width: 100%;
    max-width: 100%;
    padding: 0 40px;
    margin: 0 auto;
}

/* ── BANNER ── */
.permanent-homes-banner {
    position: relative;
    width: 100%;
    min-height: 330px;
    background: url('../images/Projects_Banner_DTP.webp') no-repeat center center / cover;
    overflow: hidden;
    display: flex;
    align-items: center;
    border-bottom: 3px solid #f1e68c;
    font-family: 'orlean';
}

.banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(0, 32, 85, 0.85) 0%,
        rgba(0, 58, 130, 0.5) 45%,
        rgba(0, 48, 110, 0.2) 100%
    );
    z-index: 1;
}

.banner-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding-left: 170px;
    padding-right: 20px;
    font-family: 'orlean';
}

.banner-content h1 {
    margin: 0;
    font-family: 'orlean';
    font-size: 78px;
    font-weight: 300;
    line-height: 1.1;
    color: #f1e68c;
    letter-spacing: 1.9px;
    
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* ── MAIN PROJECT TABS ── */
.vertex-project-tabs-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8%;
    position: relative;
    margin: 50px auto 40px;
    max-width: 1450px;
    padding: 0 20px;
    flex-wrap: wrap;
    width: 100%;
}

.vertex-project-tab-btn {
    font-family: 'orlean';
    position: relative;
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 12px 0 10px;
    font-size: 35px;
    font-weight: 300;
    line-height: 1.1;
    color: #d9d0ca;
    transition: all 0.4s ease;
    white-space: nowrap;
    display: inline-block;
    overflow: visible;
}

.vertex-project-tab-btn span {
    font-family: 'orlean';
    position: relative;
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 12px 0 10px;
    font-size: 35px;
    font-weight: 300;
    line-height: 1.1;
    color: #d9d0ca;
    transition: all 0.4s ease;
    letter-spacing: 0.9px;
    white-space: nowrap;
    display: inline-block;
    overflow: visible;
}

.vertex-project-tab-btn:hover {
    color: #c9b8a8;
}

.vertex-project-tab-btn.active {
    background-clip: text;
    font-family: 'orlean';
}

.vertex-project-tab-btn.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #9b6948 0%, #4e86c7 100%);
}

.vertex-project-tab-content-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    overflow: visible;
}

.vertex-project-tab-pane {
    display: none;
    animation: fadeInTab 0.5s ease-in;
}

.vertex-project-tab-pane.active {
    display: block;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── SUB FILTER ── */
.vertex-sub-filter-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-bottom: 45px;
    font-family: 'orlean';
    background: #fff;
    border-radius: 10px;
    width: 100%;
    flex-wrap: wrap;
    overflow: visible;
}

.sub-filter-icon {
    color: #666;
    font-size: 18px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sub-tabs-list {
    display: flex;
    gap: 45px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
}

.sub-item {
    cursor: pointer;
    font-size: 16px;
    color: #d9d0ca;
    font-weight: 400;
    position: relative;
    padding-bottom: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-block;
    overflow: visible;
    font-family: 'orlean';
    letter-spacing: 0.9px;
}

.sub-item:hover {
    color: #9b6948;
}

.sub-item::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #9b6948 0%, #4e86c7 100%);
    transition: width 0.3s ease;
}

.sub-item:hover::after,
.sub-item.active::after {
    width: 100%;
}

.sub-item.active {
    color: #9b6948;
    font-weight: 600;
}

/* ── PROJECT GRID DESKTOP ── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 42px;
    align-items: start;
    width: 100%;
}

.project-card-wrap {
    min-width: 0;
    width: 100%;
}

/* These rules protect card alignment even if another CSS file controls card design */
.project-card {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.project-image,
.project-image img {
    width: 100%;
    max-width: 100%;
}

.project-image img {
    height: auto;
    object-fit: cover;
}

.project-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.project-logo img {
    width: 65%;
    max-width: 220px;
    display: block;
}

/* Scroll indicator lines */
.projects-scroll-lines {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.projects-scroll-lines .scroll-line {
    width: 38px;
    height: 3px;
    background: #d6d1cb;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.projects-scroll-lines .scroll-line.active {
    background: #9e7451;
    width: 54px;
}

.projects-grid.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

/* =====================================================
   LARGE TABLET 1025px - 1199px
===================================================== */
@media (max-width: 1199px) {
    .projects-section .container {
        padding: 0 28px;
    }

    .banner-content {
        padding-left: 100px;
        padding-right: 24px;
    }

    .banner-content h1 {
        font-size: 58px;
        line-height: 1.15;
    }

    .vertex-project-tabs-wrap {
        gap: 40px;
    }

    .vertex-project-tab-btn,
    .vertex-project-tab-btn span {
        font-size: 28px;
    }

    .sub-tabs-list {
        gap: 28px;
    }

    .projects-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 28px;
    }
}

/* =====================================================
   TABLET 768px - 1024px
===================================================== */
@media (max-width: 1024px) {
    .projects-section .container {
        padding: 0 20px;
    }

    .permanent-homes-banner {
        min-height: 260px;
    }

    .banner-content {
        padding-left: 50px;
        padding-right: 20px;
    }

    .banner-content h1 {
        font-size: 46px;
        line-height: 1.15;
        /*letter-spacing: 0.9px;*/
    }

    .vertex-project-tabs-wrap {
        justify-content: center;
        gap: 22px;
        margin: 36px auto 30px;
        padding: 0 10px;
    }

    .vertex-project-tab-btn,
    .vertex-project-tab-btn span {
        font-size: 24px;
        padding: 10px 0 8px;
    }

    .vertex-project-tab-btn.active::after {
        bottom: 0;
        height: 2px;
    }

    .vertex-project-tab-content-wrap {
        padding: 24px 0;
    }

    .vertex-sub-filter-wrap {
        gap: 20px;
        margin-bottom: 30px;
        padding: 0;
    }

    .sub-tabs-list {
        gap: 20px;
    }

    .sub-item {
        font-size: 21px;
        padding-bottom: 6px;
    }

    .projects-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 24px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        cursor: grab;
        padding: 8px 0 14px 0;
        margin: 0;
        width: 100%;
    }

    .projects-grid::-webkit-scrollbar {
        display: none;
    }

    .project-card-wrap {
        flex: 0 0 calc((100% - 24px) / 2);
        min-width: calc((100% - 24px) / 2);
        max-width: calc((100% - 24px) / 2);
        margin-left: 0 !important;
        scroll-snap-align: start;
    }

    .projects-scroll-lines {
        display: flex;
    }
}

/* =====================================================
   MOBILE <= 767px
   Main fix: card width = viewport minus equal side gap
===================================================== */
@media (max-width: 767px) {
    .projects-section {
        overflow: hidden;
    }

    .projects-section .container {
        padding: 0 !important;
        max-width: 100% !important;
        overflow: hidden;
    }

    .permanent-homes-banner {
        min-height: 220px;
        align-items: flex-end;
        background-image: url('../images/Projects_Banner_MBL.webp');
        background-position: center center;
        background-size: cover;
        border-bottom: 2px solid #f1e68c;
        padding: 0 20px;
    }

    .banner-content {
        padding: 0 16px 24px;
    }

    .banner-content h1 {
        font-size: 32px;
        line-height: 1.2;
        /*letter-spacing: 0.9px;*/
    }

    /* Main tabs: single row with proper horizontal scroll */
    .vertex-project-tabs-wrap {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 16px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 0 18px !important;
        margin: 26px auto 24px !important;
        width: 100% !important;
        max-width: 100% !important;
        scroll-snap-type: x proximity;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    .vertex-project-tabs-wrap::-webkit-scrollbar {
        display: none;
    }

    .vertex-project-tabs-wrap {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .vertex-project-tab-btn {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        text-align: center;
        scroll-snap-align: start;
    }

    .vertex-project-tab-btn,
    .vertex-project-tab-btn span {
        font-size: 22px !important;
        line-height: 1.2;
        padding: 6px 0 7px;
    }

    .vertex-project-tab-btn.active::after {
        bottom: 0;
        height: 2px;
    }

    .vertex-project-tab-content-wrap {
        padding: 18px 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    /* Sub tabs: keep clean and centered */
    .vertex-sub-filter-wrap {
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 12px !important;
        margin: 0 0 28px !important;
        padding: 0 16px !important;
        width: 100%;
        overflow: hidden;
    }

    .sub-filter-icon {
        display: none !important;
    }

    .sub-tabs-list {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 18px !important;
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 0 0 4px !important;
        margin: 0 !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .sub-tabs-list::-webkit-scrollbar {
        display: none;
    }

    .sub-item {
        flex: 0 0 auto;
        font-size: 18px !important;
        line-height: 1.2;
        padding-bottom: 6px;
        white-space: nowrap;
    }

    /* Project title alignment */
    .project-top-title,
    .project-title-animate {
        width: calc(100vw - 40px) !important;
        max-width: calc(100vw - 40px) !important;
        margin: 0 auto 20px !important;
        text-align: center !important;
        line-height: 1.15 !important;
        word-break: keep-all !important;
        overflow-wrap: normal !important;
    }

    .project-title-animate .pt-word,
    .project-title-animate .pt-char,
    .project-title-animate .pt-char-inner,
    .project-title-animate .pt-space {
        font: inherit !important;
        color: inherit !important;
        line-height: inherit !important;
        letter-spacing: inherit !important;
    }

    .project-title-animate .pt-word {
        display: inline-flex !important;
        white-space: nowrap !important;
    }

    .project-title-animate .pt-space {
        display: inline-block !important;
        width: 0.28em !important;
    }

    /* Main card scroll: equal left/right spacing */
    .projects-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 16px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        cursor: grab;
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 8px 20px 16px !important;
        scroll-padding-left: 20px;
        scroll-padding-right: 20px;
    }

    .projects-grid::-webkit-scrollbar {
        display: none;
    }

    .project-card-wrap,
    .project-card-wrap:first-child,
    .project-card-wrap:last-child {
        flex: 0 0 calc(100vw - 40px) !important;
        min-width: calc(100vw - 40px) !important;
        max-width: calc(100vw - 40px) !important;
        width: calc(100vw - 40px) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        scroll-snap-align: start;
    }

    .project-card {
        width: 93% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .project-image {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden;
    }

    .project-image img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        display: block;
        object-fit: cover;
    }

    .project-logo img {
        width: 62% !important;
        max-width: 190px;
        margin: 0 auto;
    }

    .projects-scroll-lines {
        display: flex;
        gap: 8px;
        margin-top: 14px;
        padding: 0 20px;
    }

    .projects-scroll-lines .scroll-line {
        width: 28px;
        height: 3px;
    }

    .projects-scroll-lines .scroll-line.active {
        width: 40px;
    }
}

/* =====================================================
   SMALL MOBILE <= 480px
===================================================== */
@media (max-width: 480px) {
    .permanent-homes-banner {
        min-height: 190px;
    }

    .banner-content {
        padding: 0 12px 18px;
    }

    .banner-content h1 {
        font-size: 30px;
        line-height: 1.25;
        margin-bottom: 9%;
    }

    .vertex-project-tabs-wrap {
        gap: 14px !important;
        padding: 0 16px !important;
    }

    .vertex-project-tab-btn,
    .vertex-project-tab-btn span {
        font-size: 18px !important;
    }

    .sub-tabs-list {
        gap: 18px !important;
        justify-content: flex-start !important;
    }

    .sub-item {
        font-size: 17px !important;
    }

    .projects-grid {
        gap: 14px !important;
        padding: 8px 18px 16px !important;
        scroll-padding-left: 18px;
        scroll-padding-right: 18px;
    }

    .project-card-wrap,
    .project-card-wrap:first-child,
    .project-card-wrap:last-child {
        flex-basis: calc(100vw - 36px) !important;
        min-width: calc(100vw - 36px) !important;
        max-width: calc(100vw - 36px) !important;
        width: calc(100vw - 36px) !important;
    }

    .project-top-title,
    .project-title-animate {
        width: calc(100vw - 36px) !important;
        max-width: calc(100vw - 36px) !important;
    }

    .projects-scroll-lines .scroll-line {
        width: 22px;
    }

    .projects-scroll-lines .scroll-line.active {
        width: 34px;
    }
}

/* =====================================================
   IPHONE SE / VERY SMALL MOBILE <= 360px
===================================================== */
@media (max-width: 360px) {
    .vertex-project-tabs-wrap {
        padding: 0 14px !important;
        gap: 12px !important;
    }

    .vertex-project-tab-btn,
    .vertex-project-tab-btn span {
        font-size: 17px !important;
    }

    .sub-item {
        font-size: 16px !important;
    }

    .projects-grid {
        padding-left: 16px !important;
        padding-right: 16px !important;
        gap: 12px !important;
        scroll-padding-left: 16px;
        scroll-padding-right: 16px;
    }

    .project-card-wrap,
    .project-card-wrap:first-child,
    .project-card-wrap:last-child {
        flex-basis: calc(100vw - 32px) !important;
        min-width: calc(100vw - 32px) !important;
        max-width: calc(100vw - 32px) !important;
        width: calc(100vw - 32px) !important;
    }

    .project-top-title,
    .project-title-animate {
        width: calc(100vw - 32px) !important;
        max-width: calc(100vw - 32px) !important;
    }
}
