@import url('./layout.css');

.main-wrapper {
    position: relative;
    min-height: 440px;
    transition: min-height 350ms ease 0s;
}

main {
    position: absolute;
    min-height: 100%;
    max-height: 100%;
    opacity: 1;
    transition: max-height 700ms cubic-bezier(1, 0, 0, 1), min-height 700ms cubic-bezier(1, 0, 0, 1), opacity 500ms linear;
    left: 0;
    right: 0;
    overflow: hidden;
    background: url(/assets/pages/blog/images/banner.webp);
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

main::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.25) 100%);
    z-index: 0;
}

main > * {
    position: relative;
    z-index: 1;
}

main.hide {
    opacity: 0;
    min-height: 0;
    max-height: 0;
}

.search-area h1 {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.search-area p {
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.search-result {
    display: grid;
    place-items: center;
    position: absolute;
    min-height: 100%;
    max-height: 100%;
    left: 0;
    right: 0;
    transform: scale(0);
    transition: 500ms cubic-bezier(0.075, 0.82, 0.165, 1);
    transition-delay: 200ms;
}

.search-result .container {
    transform: translateY(20%);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-direction: column;
    gap: 1rem;
    padding-block-end: 4rem;
    border-bottom: 2px solid var(--color-border);
}

.search-result .result-title {
    font-size: 40px;
    font-weight: 500;
    color: var(--color-dark);
}

.search-result .result-title span {
    color: #00000073;
}

.search-result.show {
    transform: scale(1);
}

@media (min-width: 1000px) {
    .search-result .container {
        padding-block-end: 2rem;
    }
}

@media (max-width: 1000px) {
    .search-result .container {
        width: 100%;
    }

    main {
        text-align: center;
    }

    .h1.heading {
        font-size: 32px;
    }

    .body-2 {
        font-size: 20px;
    }
}

.search {
    overflow: hidden;
    position: relative;
    height: 48px;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    background-color: white;
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 200ms ease;
}

.search:focus-within {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--color-pink);
}

.search input {
    border: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: white;
    border: none;
    outline: none;
    text-indent: 3%;
    font-size: 15px;
}

.search-result .container .search {
    width: 60%;
}

.search button {
    cursor: pointer;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    height: 100%;
    width: 50px;
    background: transparent;
    border: none;
    border-left: 1px solid var(--color-border);
    transition: background-color 200ms ease;
}

.search button:hover {
    background-color: #f5f5f5;
}

.tabs {
    height: 56px;
    position: relative;
    width: 100%;
    overflow-x: scroll;
    scrollbar-width: none;
    margin-block-start: 1.5rem;
}

.tabs .tab-indicator {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 124px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background-color: var(--color-pink);
    transition: left 300ms cubic-bezier(0.215, 0.610, 0.355, 1);
}

.tabs ul {
    display: flex;
    height: 100%;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tabs--item {
    cursor: pointer;
    height: 100%;
    display: grid;
    place-items: center;
    width: 124px;
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-dark);
    border-bottom: 1px solid var(--color-border);
    transition: color 250ms cubic-bezier(0.895, 0.03, 0.685, 0.22);
    letter-spacing: 0.01em;
}

.tabs--item:hover {
    color: var(--color-pink);
}

.tabs--item.active {
    color: var(--color-pink);
}

.articles {
    padding-block-end: 2rem;
}

article {
    display: flex;
    padding-block: 1.5rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    transition: transform 200ms ease;
}

article:last-child {
    border-bottom: none;
}

article:hover {
    transform: translateX(4px);
}

article .article-content {
    min-height: 200px;
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

article .article-content p {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.6;
}

article .article-image--desktop {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    flex: 1;
    background-color: #f0f0f0;
    background: var(--url);
    background-size: cover;
    background-position: center;
    transition: transform 300ms ease, box-shadow 300ms ease;
}

article:hover .article-image--desktop {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.article-image--mobile {
    display: none;
    background: var(--url);
    background-size: cover;
    background-position: center;
}

article .article-header {
    list-style: none;
    gap: 0.75rem;
    font-size: 13px;
    color: var(--color-grey-500);
    font-weight: 400;
}

article .article-content h2 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-dark);
    transition: color 200ms ease;
}

article .article-content a:hover h2 {
    color: var(--color-pink);
}

article .article-content p {
    font-size: 16px;
    font-weight: 400;
    color: var(--color-grey-500);
    line-height: 1.7;
}

.article-keywords a {
    font-weight: 400;
    font-size: 12px;
    color: var(--color-pink);
    background: #FFE6F1;
    border: 1px solid #FF9BC5;
    padding-inline: 1rem;
    border-radius: 8px;
}

.no-result {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    gap: 1rem;
}

.no-result h2 {
    color: var(--color-dark);
    font-size: 28px;
    font-weight: 500;
}

.no-result ul {
    color: var(--color-grey-500);
}

@media (min-width: 768px) {
    .search-result {
        padding-block-start: 76px;
    }
}

@media (max-width: 767px) {
    .no-result h2 {
        font-size: 24px;
    }

    main {
        padding-block-start: 76px;
    }

    .search-result .container {
        padding-block-end: 1rem;
    }

    .search,
    .search-result .container .search {
        width: 90%;
    }

    .search-result .result-title {
        font-size: 32px;
    }

    article .article-image--desktop {
        display: none;
    }

    .article-content p {
        display: none;
    }

    article .article-content h2 {
        font-size: 20px;
    }

    .area--mobile {
        display: flex;
        gap: 1rem;
    }

    .area--mobile h2 {
        flex: 2;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 4;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .article-image--mobile {
        overflow: hidden;
        flex: 1;
        display: block;
        background-color: #f0f0f0;
        border-radius: 12px;
        min-height: 100px;
    }

    article {
        padding-block: 1rem;
    }

    article:hover {
        transform: none;
    }
}
