﻿.community-page {
    margin: 24px auto 40px;
    padding: clamp(18px, 3vw, 32px);
    border: 1px solid #263247;
    border-radius: 24px;
    background: #0e1420;
    overflow-wrap: anywhere;
}

.community-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

    .community-heading h1 {
        margin-bottom: 8px;
        font-size: clamp(1.8rem, 4vw, 2.7rem);
        font-weight: 750;
        letter-spacing: -0.04em;
    }

    .community-heading p {
        margin: 0;
        color: #a9b6c9;
    }

.community-garage-link {
    flex-shrink: 0;
    padding: 12px 18px;
    border: 1px solid #435d81;
    border-radius: 12px;
    color: #d6e3ff;
    text-decoration: none;
    font-weight: 600;
}

    .community-garage-link:hover {
        border-color: #8caaff;
        background: #1c2b43;
        color: #fff;
    }

/* Search */

.community-search {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

    .community-search input[type="search"] {
        flex: 1;
        min-width: 0;
        padding: 13px 16px;
        border: 1px solid #34465f;
        border-radius: 12px;
        background: #172334;
        color: #edf2fb;
        font: inherit;
    }

    .community-search input::placeholder {
        color: #9babc2;
    }

    .community-search button {
        padding: 12px 22px;
        border: 1px solid transparent;
        border-radius: 12px;
        background: #345cff;
        color: #fff;
        font: inherit;
        font-weight: 600;
    }

        .community-search button:hover {
            background: #466bff;
        }

/* Manufacturer filters */

.community-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
    padding-bottom: 8px;
    overflow-x: auto;
}

.community-filter {
    flex-shrink: 0;
    padding: 11px 18px;
    border: 1px solid #2e3b50;
    border-radius: 999px;
    background: #182131;
    color: #b9c6db;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

    .community-filter:hover {
        border-color: #6487e6;
        color: #fff;
    }

    .community-filter.is-active {
        border-color: #345cff;
        background: #345cff;
        color: #fff;
    }

/* Vehicle cards */

.community-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 24px;
}

.community-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #30415a;
    border-radius: 20px;
    background: #172232;
    box-shadow: 0 12px 28px rgb(0 0 0 / 15%);
}

.community-card-owner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    color: #dce5f5;
    font-size: 0.9rem;
    font-weight: 600;
}

.community-owner-avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 1px solid #607fe6;
    border-radius: 50%;
    background: #2946ab;
    color: #fff;
    font-weight: 700;
}

.community-card-photo {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #101927;
}

    .community-card-photo img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.community-photo-placeholder {
    display: grid;
    place-items: center;
    height: 100%;
    padding: 20px;
    color: #95a7c0;
    background: linear-gradient(135deg, #1d2c42, #111925);
}

.community-card-details {
    padding: 20px;
    flex: 1;
}

.community-card-year {
    margin-bottom: 8px;
    color: #a7bdff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.community-card-details h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.community-card-model {
    margin: 8px 0 0;
    color: #b7c7de;
    font-size: 0.95rem;
}

.community-card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #30415a;
}

    .community-card-specs span {
        padding: 6px 10px;
        border-radius: 8px;
        background: #101b2b;
        color: #bed0ec;
        font-size: 0.8rem;
    }

/* Empty results and pagination */

.community-empty {
    padding: 44px 20px;
    border: 1px dashed #435878;
    border-radius: 18px;
    text-align: center;
}

    .community-empty h2 {
        font-size: 1.4rem;
    }

    .community-empty p {
        color: #a9b6c9;
    }

    .community-empty a {
        color: #a7bdff;
    }

.community-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    color: #adbed7;
}

    .community-pagination a {
        padding: 10px 16px;
        border: 1px solid #435878;
        border-radius: 10px;
        color: #edf2fb;
        text-decoration: none;
    }

        .community-pagination a:hover {
            background: #243650;
        }

.community-page a:focus-visible,
.community-page button:focus-visible,
.community-page input:focus-visible {
    outline: 2px solid #a7bdff;
    outline-offset: 4px;
}

/* Smaller desktop windows and tablets */

@media (max-width: 1100px) {
    .community-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile */

@media (max-width: 600px) {
    .community-page {
        padding: 12px;
        border-radius: 20px;
    }

    .community-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
        margin-bottom: 22px;
    }

        .community-heading h1 {
            font-size: 1.8rem;
        }

        .community-heading p {
            font-size: 0.9rem;
        }

    .community-search {
        gap: 8px;
        margin-bottom: 16px;
    }

        .community-search input[type="search"] {
            padding: 12px;
            font-size: 0.85rem;
        }

        .community-search button {
            padding: 12px;
            font-size: 0.85rem;
        }

    .community-filters {
        gap: 8px;
        margin-bottom: 18px;
    }

    .community-filter {
        padding: 10px 14px;
        font-size: 0.8rem;
    }

    .community-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 12px;
    }

    .community-card {
        display: flex;
        flex-direction: column;
        border-radius: 14px;
        box-shadow: none;
    }

    .community-card-owner {
        gap: 6px;
        padding: 9px;
        font-size: 0.75rem;
    }

        .community-card-owner > span:last-child {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .community-owner-avatar {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .community-card-photo {
        flex-shrink: 0;
        aspect-ratio: 4 / 3;
    }

    .community-photo-placeholder {
        padding: 10px;
        text-align: center;
        font-size: 0.75rem;
    }

    .community-card-details {
        flex: 1;
        padding: 12px 10px 4px;
    }

    .community-card-year {
        margin-bottom: 6px;
        font-size: 0.65rem;
        letter-spacing: 0.03em;
    }

    .community-card-details h2 {
        font-size: 1rem;
        line-height: 1.3;
    }

    .community-card-model {
        margin-top: 6px;
        font-size: 0.78rem;
        line-height: 1.4;
    }

    .community-card-specs {
        display: none;
    }

    .community-page .community-view-build {
        margin: 0 10px 4px;
        font-size: 0.8rem;
    }
}

/* Public build photo gallery */

.public-photo-gallery {
    border-top: 2px solid #6085e8;
    background: #101927;
}

    .public-photo-gallery .carousel-item {
        aspect-ratio: 4 / 3;
    }

        .public-photo-gallery .carousel-item > img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

    .public-photo-gallery .carousel-control-prev,
    .public-photo-gallery .carousel-control-next {
        top: 50%;
        bottom: auto;
        width: 44px;
        height: 52px;
        border-radius: 12px;
        background: rgb(10 18 30 / 75%);
        opacity: 1;
        transform: translateY(-50%);
    }

    .public-photo-gallery .carousel-control-prev {
        left: 12px;
    }

    .public-photo-gallery .carousel-control-next {
        right: 12px;
    }

    .public-photo-gallery .public-photo-thumbnails {
        justify-content: flex-start;
        gap: 8px;
        margin: 0;
        padding: 24px 14px 12px;
        overflow-x: auto;
        background: linear-gradient(transparent, rgb(8 14 24 / 85%));
    }

        .public-photo-gallery .public-photo-thumbnails button {
            box-sizing: border-box;
            flex: 0 0 72px;
            width: 72px;
            height: 54px;
            margin: 0;
            padding: 0;
            overflow: hidden;
            border: 2px solid transparent;
            border-radius: 9px;
            background: #172232;
            text-indent: 0;
            opacity: 0.65;
        }

            .public-photo-gallery .public-photo-thumbnails button.active {
                border-color: #8caaff;
                opacity: 1;
            }

.public-photo-thumbnails img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.public-photo-gallery button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

.public-photo-empty {
    display: grid;
    place-items: center;
    min-height: 240px;
    padding: 24px;
    color: #a9b6c9;
    background: #101927;
}

.public-build-title {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 750;
    letter-spacing: -0.03em;
}

.community-view-build {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 44px;
    margin: 0 20px 8px;
    padding: 8px 0;
    border-radius: 6px;
    background: transparent;
    color: #a7bdff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

    .community-view-build::after {
        content: "→";
        font-size: 1.15rem;
    }

    .community-view-build:hover {
        background: transparent;
        color: #fff;
    }

.public-build .garage-story p,
.public-build .garage-mod-list p {
    white-space: pre-line;
}

.public-build a:focus-visible {
    outline: 2px solid #a7bdff;
    outline-offset: 4px;
}

/* Compact gallery toolbar */

.community-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

    .community-toolbar .community-filter {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        margin: 0;
        font: inherit;
        font-size: 0.85rem;
        font-weight: 600;
    }

.community-make-dropdown {
    min-width: 0;
}

    .community-make-dropdown > button {
        max-width: 100%;
        gap: 8px;
    }

        .community-make-dropdown > button > span {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

.community-make-menu {
    max-height: min(50vh, 320px);
    min-width: 210px;
    padding: 6px;
    overflow-y: auto;
    border: 1px solid #354964;
    border-radius: 14px;
    background: #172232;
    box-shadow: 0 16px 36px rgb(0 0 0 / 35%);
}

    .community-make-menu .dropdown-item {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 10px 12px;
        border-radius: 8px;
        color: #dce5f5;
        font-size: 0.9rem;
    }

        .community-make-menu .dropdown-item:hover,
        .community-make-menu .dropdown-item:focus {
            background: #263952;
            color: #fff;
        }

        .community-make-menu .dropdown-item.active {
            background: #345cff;
            color: #fff;
        }

.community-search-toggle {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    border: 1px solid #34465f;
    border-radius: 50%;
    background: #182131;
    color: #b9c6db;
}

    .community-search-toggle:hover,
    .community-search-toggle[aria-expanded="true"] {
        border-color: #6487e6;
        background: #243650;
        color: #fff;
    }

    .community-search-toggle svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
    }

.community-search-panel .community-search {
    margin-bottom: 20px;
}

.community-active-search {
    margin-bottom: 20px;
}

    .community-active-search a {
        display: inline-flex;
        align-items: center;
        gap: 12px;
        max-width: 100%;
        min-height: 44px;
        padding: 8px 14px;
        border: 1px solid #435d81;
        border-radius: 12px;
        background: #192a42;
        color: #c8d8ff;
        text-decoration: none;
        overflow-wrap: anywhere;
    }

        .community-active-search a:hover {
            border-color: #8caaff;
            color: #fff;
        }

@media (max-width: 600px) {
    .community-toolbar {
        gap: 6px;
    }

        .community-toolbar .community-filter {
            padding: 10px 12px;
            font-size: 0.75rem;
        }

    .community-make-dropdown {
        flex: 0 1 auto;
    }
}

/* Links to member profiles */

.community-owner-link {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .community-owner-link:hover {
        color: #a7bdff;
    }

.community-profile-link {
    color: #a7bdff;
    text-decoration: none;
    font-weight: 600;
}

    .community-profile-link:hover {
        color: #fff;
        text-decoration: underline;
    }

/* Member photos on gallery cards */

.community-owner-avatar {
    overflow: hidden;
}

    .community-owner-avatar img {
        display: block;
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 0;
        object-fit: cover;
        border-radius: inherit;
    }

.community-card {
    position: relative;
}

.community-build-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.community-card:hover,
.community-card:focus-within {
    border-color: #8caaff;
}

.community-build-link:focus-visible {
    outline: none;
}

    .community-build-link:focus-visible::after {
        outline: 2px solid #a7bdff;
        outline-offset: -3px;
        border-radius: inherit;
    }

.community-card .community-owner-link {
    position: relative;
    z-index: 2;
}

.community-card-details {
    padding-bottom: 16px;
}

.public-build .garage-mod-list p.garage-mod-credit {
    margin: 6px 0 0;
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: normal;
    text-align: left;
}

.build-owner-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    padding: 10px 14px;
    border: 1px solid #354964;
    border-radius: 14px;
    background: #172232;
    color: #edf2fb;
    text-decoration: none;
}

    .build-owner-badge:hover {
        border-color: #8caaff;
        background: #1b2d50;
        color: #fff;
    }

.build-owner-avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    overflow: hidden;
    border: 1px solid #607fe6;
    border-radius: 50%;
    background: #2946ab;
    color: #fff;
    font-weight: 700;
}

    .build-owner-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.build-owner-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

    .build-owner-text strong {
        overflow-wrap: anywhere;
        font-size: 0.9rem;
    }

    .build-owner-text > span {
        color: #a7bdff;
        font-size: 0.75rem;
    }

.build-owner-chevron {
    margin-left: 8px;
    color: #a7bdff;
    font-size: 1.5rem;
}

.build-page-heading {
    margin-bottom: 22px;
}

.build-page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.build-back-link {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 1px solid #435d81;
    border-radius: 12px;
    background: transparent;
    color: #a7bdff;
    text-decoration: none;
    font-size: 1.6rem;
    line-height: 1;
}

    .build-back-link:hover {
        border-color: #8caaff;
        background: #1b2d50;
        color: #fff;
    }

.build-page-toolbar .build-owner-badge {
    min-width: 0;
    max-width: calc(100% - 56px);
    margin-left: auto;
}

.build-page-toolbar .build-owner-badge {
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
}

    .build-page-toolbar .build-owner-badge:hover {
        background: transparent;
    }

.build-page-toolbar .build-owner-avatar {
    width: 44px;
    height: 44px;
}

.build-page-toolbar .build-owner-badge:hover .build-owner-avatar {
    border-color: #a7bdff;
}