/* 검색과 쓰기 searchAndWrite */

#list .searchAndWrite {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 32px;
    margin: 0 auto;
}

#list .searchAndWrite input {
    margin: 0 8px;
}

#list .searchAndWrite form {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
}

#list .searchAndWrite .search {
    display: flex;
    flex: 1;
}

/* 카테고리 3 선택 */

#list .categories {
    display: flex;
    flex-direction: row;
    gap: 8px;
    width:100%;
    padding-top:4px;
    overflow-x: auto;
    overflow-y: hidden;
    font-size: 0.875rem;
}

#list .category {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    z-index: 1;
}

#list .category a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height:34px;
    padding: 0 12px;
    color: var(--alpha-70);
    text-decoration: none;
    border:1px solid var(--alpha-10);
    border-radius: 50vh;
}

@media only screen and (min-width: 1200px) {
    #list .categories{
        flex-wrap: wrap;
    }
}

#list .category a:hover,
 #list .category a:active {
    background-color: var(--alpha-5);
    background-image: none;
    border: 1px solid var(--alpha-20);
}

#list .category a span {
    white-space: nowrap;
}

#list .category a.current {
    font-weight:700 !important;
    color: var(--point-color) !important;
    background: #E8F6F7 !important; /* 다크모드 대응색 있어야 */
    border: 1px solid #BFE6E9 !important; /* 다크모드 대응색 있어야 */
}

#list .category a.current:hover,
 #list .category a.current:active {
    font-weight: 700 !important;
    color: var(--point-color) !important;
    background: #D2EEEF !important;
    border: 1px solid var(--point-backgrorund-color-30, rgb(28 168 175 / 30%)) !important;
}

#list .category a.popular {
    position: relative;
    left: 2px;
    box-sizing: border-box;
    min-height: 31px;
    background: var(--default-background-color);
    border: 1px solid transparent;
    border-radius: 50vh;

    --borderWidth: 1px;
}

#list .category a.popular::after {
    position: absolute;
    top: -2px;
    left: -2px;
    z-index: -1;
    box-sizing: border-box;;
    width: calc(100% + var(--borderWidth) * 4);
    height: calc(100% + var(--borderWidth) * 4);
    content: '';
    background: linear-gradient(60deg, #94FFDF, #4B9EFF, #94FFDF, #4B9EFF, #94FFDF);
    background-size: 300% 300%;
    border-radius: 50vh;
    animation: animatedgradient 3s ease alternate infinite;
}

#list .category a.popular:hover,
 #list .category a.popular:active {
    background-color: var(--alpha-reverse-90);
}


@keyframes animatedgradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

#list .category a.popular img {
    width:16px;
    height:18px;
    margin-left: 2px;
    animation: fire 1s ease-in;
}

@keyframes fire {
    0% {
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    40% {
        transform: rotate(-3deg);
        transform-origin: 50% 100%;
    }

    50% {
        opacity: 1;
        transform: rotate(6deg);
        transform-origin: 50% 100%;
    }

    70% {
        opacity: 1;
        transform: rotate(-6deg);
        transform-origin: 50% 100%;
    }

    90% {
            opacity: 1;
            transform: rotate(6deg);
            transform-origin: 50% 100%;
        }

    100% {
            opacity: 1;
            transform: rotate(-3deg);
            transform-origin: 50% 100%;
        }

}

#list .category a.popular span {
    white-space: nowrap;
    animation : fadeIn 0.3s linear;
}

@keyframes fadeIn {
    0% {
            opacity: 0;
        }

    100% {
            opacity: 1;
    }
}


@media only screen and (max-width: 1199px) {
    section#title .write-btn {
        display:none;
    }

    #list .searchAndWrite {
        width: 100%; /* 1104 추가 */
        padding: 0 16px 16px;
    }

    #list .searchAndWrite form {
        width: 100%;
        max-width: 400px; /* 1104 추가 */
        margin: 0 auto; /* 1104 추가 */
    }

    #list .searchAndWrite .search input {
        width: 100%;
    }

}

@media only screen and (min-width: 1200px) {
    section#title .write-btn {
        height:fit-content;
        margin-bottom:14px;
        white-space: nowrap;
    }

    #list .searchAndWrite {
        gap: 0;
        padding-top: 8px;
        padding-bottom: 48px;
    }

    #list .searchAndWrite .write-btn {
        display:none;
    }

    #list .Write {
        gap: 0;
        width: 100%; /* 1104 추가 */
        padding-top: 8px;
        padding-bottom: 48px;
    }

    #list .Write .write-btn {
        display:none;
    }
}

/* iOS 별도출력 */
@supports (-webkit-hyphens:none) {
    #list .category a.popular {
        left: 1px !important;
        min-height: 32px !important;
    }
}