/* ── render_component.css ── */
/* QnA 프리뷰 (renderQnaArticlePreview) */
.partnership-preview-container {
    color: inherit;
    border-bottom: 1px solid rgb(var(--gray-100));
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    padding-bottom: 16px;
    gap: 4px;
}
.partnership-preview-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.partnership-preview-right {
    flex-shrink: 0;
}

/* 공지사항 프리뷰 (renderNoticeArticlePreview) */
.notice-preview-container {
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 0;
    border-bottom: 1px solid rgb(var(--gray-100));
    cursor: pointer;
}

/* 차단 목록 (renderBlockedUserItem) */
.block-list-item-container {
    border-bottom: 1px solid rgb(var(--gray-100));
    padding-top: 10px;
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
}
.block-list-item-container img {
    width: 40px;
    height: 40px;
    border-radius: 100%;
    object-fit: cover;
}
.block-list-item-container button {
    background-color: transparent;
    border-radius: 4px;
    border: 1px solid rgb(var(--primary-700));
    color: rgb(var(--primary-700));
    padding: 3px 12px;
}
.block-list-item-container button:active {
    background-color: rgb(var(--gray-100));
}

/* D-Day 편지 프리뷰 (renderLetterArticlePreview) */
.dday-letter-preview-container {
    display: block;
    background-color: white;
    width: 100%;
    padding-top: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgb(var(--gray-100));
}
.dday-letter-content {
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* D-Day 시기별 토글 (renderToggleItem02) */
.dday-period-img {
    width: 24px;
    height: 24px;
    border-radius: 100%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
}
.dday-period-img img {
    width: 85%;
    height: 85%;
}

/* 임시저장 프리뷰 (renderDraftItem) */
.fragment-draft-preview-item {
    border-bottom: 1px solid rgb(var(--gray-100));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 52px;
}
.fragment-draft-preview-item .draft-title-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fragment-draft-preview-item .draft-title-box .draft-title {
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.fragment-draft-preview-item .delete-btn {
    cursor: pointer;
}

/* ── modal_fullscreen.css ── */
.modal-fullscreen {
    left: 50% !important;
    top: 50% !important;
    transform: translateX(-50%) translateY(-50%) !important;
    transition: none;
}

.modal-fullscreen > .modal-content {
    width: 100% !important;
    height: 100% !important;
}
/* ── style.css ── */
/************************* 검색어 하이라트 start *************************/
.highlight {
    background-color: rgb(var(--primary-100));
}
/************************* 검색어 하이라트 end *************************/

/************************* Toast start *************************/
.toast-container {
    position: absolute;
    bottom: calc(68px + var(--safe-area-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    font: var(--font-body2-r) !important;

    width: 100%;
    height: auto;
}
.toast-container .custom-toast {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    padding: 12px 16px;
    text-align: center;
    transition: opacity 0.5s ease;
    opacity: 0;
}
/************************* Toast end *************************/

/************************* header start *************************/
.mobile-status-bar {
    background-color: white;
    flex-shrink: 0;
}
.header {
    flex-shrink: 0;
}
/* 헤더 아이콘/버튼 터치 피드백 */
.header a,
.header button,
.header-right > img[id] {
    transition: transform 0.15s ease, opacity 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.header a:active,
.header button:active,
.header-right > img[id]:active {
    transform: scale(0.8);
    opacity: 0.5;
    transition: transform 0.06s ease, opacity 0.06s ease;
}
/************************* header end *************************/

/************************* 공용 레이아웃 start *************************/
html, body {
    overflow: hidden;
    overflow: clip;     /* iOS 16+: hidden보다 강력한 스크롤 차단 */
}
/* assets/css/style.css의 html { background-color: gray-400 }은 PC 접속 시 레터박스용인데
   조건이 없어 네이티브 앱에도 적용됨 → 전환 중 body가 잠깐 화면을 덜 덮을 때 회색이 비쳐 보임.
   네이티브 앱에서는 흰색으로 되돌림. */
html.native-app {
    background-color: rgb(var(--white));
}
body {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100svh;
}
.page-layout {
    background-color: rgb(var(--gray-50));
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}
.page-layout .page-container {
    width: 100%;
    flex-grow: 1;
    min-height: 0;

    display: flex;
    flex-direction: column;

    position: relative;
}
.page-layout .page-container .page-main-scroll {
    position: relative;

    flex: 1;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    /* body가 fixed라 위로 전파할 부모 스크롤이 없음 → contain은 iOS(WebKit)에서 전파만 막고
       자체 고무줄 바운스는 그대로 남겨서 화면이 과하게 밀림. none으로 바운스 자체를 차단.
       풀투리프레시(infiniteScroll.js)는 scrollTop 값만 보는 자체 터치 로직이라 영향 없음. */
    overscroll-behavior: none;

    scrollbar-width: none;
}
.page-layout .page-container .page-main-scroll::-webkit-scrollbar {
    display: none;
}
/************************* 공용 레이아웃 end *************************/

/************************* 가로 스크롤 start *************************/
/* horizontal-scroll-wrapper의 너비를 고정해줘야 됨 */
.horizontal-scroll-wrapper {
    width: 100%;
    position: relative;
}

.horizontal-scroll-wrapper .horizontal-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    /*
     * pan-x 만 허용하면 이 위에서 세로로 쓸었을 때 브라우저가 세로 스크롤을 아예 막는다.
     * (가로 칩/탭 줄 위에서 화면이 안 움직이던 원인)
     * pan-x pan-y 로 두면 제스처 방향에 따라 브라우저가 알아서 가른다.
     */
    touch-action: pan-x pan-y;
}
.horizontal-scroll-wrapper .horizontal-scroll::-webkit-scrollbar {
    display: none;
}

/* 고정된 위치에 gradient 배치 */
.horizontal-scroll-wrapper::before,
.horizontal-scroll-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    width: 40px;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.horizontal-scroll-wrapper::before {
    left: 0;
    background: linear-gradient(to right, rgb(var(--gray-50)), transparent);
    opacity: 0;
}
.horizontal-scroll-wrapper::after {
    right: 0;
    background: linear-gradient(to left, rgb(var(--gray-50)), transparent);
    opacity: 0;
}

.horizontal-scroll-wrapper.horizontal-scroll-gray-100::before {
    background: linear-gradient(to right, rgb(var(--gray-100)), transparent);
}
.horizontal-scroll-wrapper.horizontal-scroll-gray-100::after {
    background: linear-gradient(to left, rgb(var(--gray-100)), transparent);
}

.horizontal-scroll-wrapper.fade-left::before { opacity: 1; }
.horizontal-scroll-wrapper.fade-right::after { opacity: 1; }
.horizontal-scroll-wrapper.fade-both::before,
.horizontal-scroll-wrapper.fade-both::after { opacity: 1; }
/************************* 가로 스크롤 end *************************/


/************************* 리스트 조회 결과 start *************************/
/* 로딩 중 (data-state 미설정): 빈 화면 깜빡임 방지 */
.search-result:not([data-state]) .search-result__initial,
.search-result:not([data-state]) .search-result__empty,
.search-result:not([data-state]) .search-result__list {
    display: none !important;
}
/* 상태: initial */
.search-result[data-state="initial"] .search-result__initial {
    display: flex;
}
.search-result[data-state="initial"] .search-result__empty,
.search-result[data-state="initial"] .search-result__list {
    display: none !important;
}
/* 상태: empty */
.search-result[data-state="empty"] .search-result__empty {
    display: flex;
}
.search-result[data-state="empty"] .search-result__initial,
.search-result[data-state="empty"] .search-result__list {
    display: none !important;
}
/* 상태: list */
.search-result[data-state="list"] .search-result__list {
    display: flex;
}
.search-result[data-state="list"] .search-result__initial,
.search-result[data-state="list"] .search-result__empty {
    display: none !important;
}

/* 디폴트 css */
.search-result {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}
.search-result .search-result__initial,
.search-result .search-result__empty {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: rgb(var(--gray-600));
    text-align: center;
}
.search-result .search-result__list {
    overflow-y: auto;
    overscroll-behavior: contain;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.search-result .search-result__list::-webkit-scrollbar {
    display: none;
}
/* 아래 목록들은 화면에 .page-main-scroll이 따로 없어(layout_header_01) 이 리스트 자체가
   최상위 스크롤 — iOS 바운스 방지 위해 none. (momstalk/list.html, mypage/tester.html처럼
   .page-main-scroll에 진짜 중첩된 목록은 그쪽으로 체이닝해야 하므로 공용 규칙(contain) 유지) */
#qna-list.search-result .search-result__list,
#partnership-list.search-result .search-result__list,
#favorite-momstalk-article-list.search-result .search-result__list,
#favorite-checklist-article-list.search-result .search-result__list,
#favorite-tester-article-list.search-result .search-result__list,
#written-article-list.search-result .search-result__list,
#commented-article-list.search-result .search-result__list,
/* 댓글 전체보기/답글달기(comment/list.html, comment/reply.html)도 .page-main-scroll 안에
   이 리스트뿐이라 실질적으로 최상위 스크롤 — 같은 이유로 예외 처리.
   (글 미리보기의 #comment-list는 overflow:visible이라 이 규칙 자체가 적용될 여지가 없음) */
#comment-list.search-result .search-result__list {
    overscroll-behavior: none;
}
/* 결과가 2열 그리드로 나열되는 경우 */
.search-result .search-result__list.search-result__list--2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    height: 100%;
}
 /************************* 리스트 조회 결과 end *************************/


/************************* Pull to Refresh start *************************/
.pull-refresh {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: rgb(var(--gray-500));
    font-size: 13px;
    z-index: 2;
}
.pull-refresh__arrow {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 14px;
}
.pull-refresh.ready .pull-refresh__arrow {
    transform: rotate(180deg);
}
.pull-refresh.refreshing .pull-refresh__arrow {
    display: none;
}
.pull-refresh__spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgb(var(--gray-300));
    border-top-color: rgb(var(--gray-500));
    border-radius: 50%;
    animation: pull-refresh-spin 0.6s linear infinite;
}
.pull-refresh.refreshing .pull-refresh__spinner {
    display: block;
}
@keyframes pull-refresh-spin {
    to { transform: rotate(360deg); }
}
/************************* Pull to Refresh end *************************/


/************************* 로딩 스피너 start *************************/
.loading-indicator {
    width: 150px;
    height: 150px;

    opacity: 0;
    transition: opacity 0.3s ease;

    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}
.loading-indicator.show {
    opacity: 1;
}
/************************* 로딩 스피너 end *************************/

/************************* 기타 start *************************/
.flex-fill {
    flex-grow: 1 !important;
    min-height: 0;
}

.hide-scrollbar {
    scrollbar-width: none; /* Firefox에서 스크롤바 숨김 */
}
.hide-scrollbar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge에서 스크롤바 숨김 */
}
/************************* 기타 end *************************/
