@import url('/themes/root.css');

* {
    box-sizing: border-box;
}

html {
    background: var(--main-page-background-color);
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--main-page-background-color);
    color: var(--main-text-color);
    font-family: var(--font-family);
}

button,
input {
    font: inherit;
}

.projects-container {
    width: 100%;
    min-height: calc(100vh - 80px);
}

.project-search {
    width: calc(100% - clamp(40px, 10vw, 144px));
    margin: 0 auto;
    padding: 48px 0 34px;
}

.project-search h1 {
    margin: 0 0 14px;
    color: var(--main-text-color);
    width: min(560px, 100%);
    margin-left: 0;
    margin-right: auto;
    font-size: 28px;
    text-align: left;
    line-height: 1.2;
    font-weight: 700;
}

.project-search h1 span {
    color: var(--title-text-color);
}

.search-bar {
    position: relative;
    width: min(560px, 100%);
    margin: 0;
}

.search-bar::before {
    content: "";
    position: absolute;
    top: 17px;
    left: 18px;
    width: 11px;
    height: 11px;
    border: 2px solid var(--sub-text-color);
    border-radius: 50%;
    pointer-events: none;
}

.search-bar::after {
    content: "";
    position: absolute;
    top: 30px;
    left: 29px;
    width: 7px;
    height: 2px;
    background: var(--sub-text-color);
    transform: rotate(45deg);
    transform-origin: left center;
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    height: 52px;
    border: 1px solid transparent;
    border-radius: 12px;
    outline: none;
    background: var(--second-box-background-color);
    color: var(--main-text-color);
    padding: 0 18px 0 48px;
    font-size: 15px;
}

.search-bar input::placeholder {
    color: var(--sub-text-color);
    opacity: 1;
}

.search-bar input:focus {
    border-color: var(--title-text-color);
}

.project-filters {
    display: flex;
    gap: 8px;
    width: min(560px, 100%);
    justify-content: flex-start;
    margin: 10px 0 0;
}

.project-filters button {
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--sub-text-color);
    padding: 0 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 30px;
}

.project-filters button:hover,
.project-filters button:focus-visible {
    color: var(--title-text-color);
}

.project-filters button.active {
    background: var(--second-box-background-color);
    color: var(--title-text-color);
}

.project-filters button:focus-visible {
    outline: 2px solid var(--title-text-color);
    outline-offset: 2px;
}

.project-overview {
    width: calc(100% - clamp(40px, 10vw, 144px));
    margin: 0 auto;
    padding-bottom: 48px;
}

.project-count {
    margin: 0 0 8px;
    color: var(--sub-text-color);
    font-size: 14px;
    line-height: 20px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.project-card[hidden] {
    display: none;
}

.project-card {
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
    height: 250px;
    overflow: hidden;
    border: 1px solid #343434;
    border-radius: 16px;
    background: var(--second-box-background-color);
}

.project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 58px;
    height: 58px;
    padding: 0 16px;
    position: relative;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.015), transparent 70%),
        var(--first-box-background-color);
}

.project-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: contain;
}

.status {
    position: static;
    margin-left: auto;
    min-width: 104px;
    height: 28px;
    border: 1px solid currentColor;
    border-radius: 14px;
    padding: 0 14px;
    text-align: center;
    font-size: 11px;
    line-height: 26px;
    font-weight: 600;
}

.status.completed {
    background: color-mix(in srgb, var(--project-tag-done) 8%, var(--first-box-background-color));
    color: var(--project-tag-done);
}

.status.planned {
    background: color-mix(in srgb, var(--project-tag-planning) 8%, var(--first-box-background-color));
    color: var(--project-tag-planning);
}

.status.in-progress {
    background: color-mix(in srgb, var(--project-tag-working) 8%, var(--first-box-background-color));
    color: var(--project-tag-working);
}

.project-content {
    flex: 1 1 auto;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 12px 16px 8px;
}

.project-content h2 {
    margin: 0 0 4px;
    color: var(--main-text-color);
    font-size: 22px;
    line-height: 1.1;
    font-weight: 700;
}

.project-content p {
    max-width: 96%;
    margin: 0;
    color: var(--sub-text-color);
    font-size: 16px;
    line-height: 1.35;
}

.project-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    border-top: 1px solid #343434;
    padding: 10px 16px;
}

.project-date {
    color: var(--sub-text-color);
    font-size: 12px;
}

.project-visit {
    display: inline-flex;
    align-items: center;
    color: var(--main-text-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.project-visit:hover,
.project-visit:focus-visible {
    color: var(--title-text-color);
}

@media (max-width: 1200px) {
    .project-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .project-search,
    .project-overview {
        width: calc(100% - 64px);
    }
}

@media (max-width: 900px) {
    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-card {
        height: 205px;
    }

    .project-header {
        flex-basis: 49px;
        height: 49px;
    }

    .project-content {
        height: auto;
    }

    .project-content h2 {
        font-size: clamp(20px, 3.2vw, 28px);
    }

    .project-content p {
        font-size: clamp(14px, 2.1vw, 20px);
    }
}

@media (max-width: 560px) {
    .project-search,
    .project-overview {
        width: calc(100% - 32px);
    }

    .project-search {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .search-bar {
        width: 100%;
    }

    .project-filters {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .project-filters button {
        flex: 0 0 auto;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        height: 205px;
        border-radius: 16px;
    }

    .project-header {
        flex-basis: 49px;
        height: 49px;
        padding: 0 12px;
    }

    .project-icon {
        width: 30px;
        height: 30px;
    }

    .status {
        min-width: 92px;
        height: 28px;
        font-size: 12px;
        line-height: 26px;
    }

    .project-content {
        flex: 1 1 auto;
        height: auto;
        padding: 12px 16px 8px;
    }

    .project-content h2 {
        font-size: clamp(22px, 7vw, 28px);
    }

    .project-content p {
        font-size: clamp(15px, 4.5vw, 20px);
        line-height: 1.35;
    }
}

