/* Custom fixes for menu/counter layout */

/* 1) 모바일 justify 메뉴 정렬 오류 수정 */
@media only screen and (max-width: 767px) {
    .hfe-nav-menu__breakpoint-mobile.hfe-nav-menu__align-justify .hfe-nav-menu__layout-horizontal .hfe-nav-menu li a.hfe-menu-item,
    .hfe-nav-menu__breakpoint-mobile.hfe-nav-menu__align-justify .hfe-nav-menu__layout-horizontal .hfe-nav-menu li a.hfe-sub-menu-item,
    .hfe-nav-menu__breakpoint-mobile.hfe-nav-menu__align-justify .hfe-nav-menu__layout-horizontal .hfe-nav-menu li.hfe-button-wrapper,
    .hfe-nav-menu__breakpoint-tablet.hfe-nav-menu__align-justify .hfe-nav-menu__layout-horizontal .hfe-nav-menu li.hfe-button-wrapper {
        -webkit-box-pack: justify;
        -webkit-justify-content: space-between;
        -moz-box-pack: justify;
        -ms-flex-pack: justify;
        justify-content: space-between;
    }
}

/* 2) 카운터 row / row-reverse 정렬 보강 */
.hfe-counter-wrapper[style*="flex-direction:row"] .hfe-counter-title,
.hfe-counter-wrapper[style*="flex-direction:row"] .hfe-counter-content,
.hfe-counter-wrapper[style*="flex-direction: row"] .hfe-counter-title,
.hfe-counter-wrapper[style*="flex-direction: row"] .hfe-counter-content,
.hfe-counter-wrapper[style*="flex-direction:row-reverse"] .hfe-counter-title,
.hfe-counter-wrapper[style*="flex-direction:row-reverse"] .hfe-counter-content,
.hfe-counter-wrapper[style*="flex-direction: row-reverse"] .hfe-counter-title,
.hfe-counter-wrapper[style*="flex-direction: row-reverse"] .hfe-counter-content {
    flex: 1;
    min-width: 0;
}

/* 3) 카운터 내부 flex 안정화 */
.hfe-counter-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hfe-counter-title {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* 4) 포커스 접근성 개선 */
.hfe-nav-menu-icon i:focus-visible,
.hfe-has-submenu-container a.hfe-menu-item:focus-visible,
.hfe-has-submenu-container a.hfe-sub-menu-item:focus-visible,
.hfe-nav-menu .menu-item-has-children:focus-visible,
.hfe-nav-menu .menu-item-has-children-container:focus-visible,
.hfe-nav-menu__toggle:focus-visible,
button.sub-menu-toggle:focus-visible,
.hfe-search-button-wrapper button:focus-visible,
.hfe-search-button-wrapper input[type=search]:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* 5) 이미지 안정화 */
.hfe-post-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 6) 검색 입력 박스 크기 계산 안정화 */
.hfe-search-button-wrapper input[type=search],
.hfe-search-button-wrapper button,
.hfe-search-form__container,
.hfe-search-form__input {
    box-sizing: border-box;
}

/* 7) 모바일/태블릿 서브메뉴 위치 안정화 */
@media only screen and (max-width: 1024px) {
    .hfe-nav-menu__breakpoint-tablet .hfe-nav-menu__layout-horizontal .menu-item-has-children .menu-item-has-children .sub-menu,
    .hfe-nav-menu__breakpoint-mobile .hfe-nav-menu__layout-horizontal .menu-item-has-children .menu-item-has-children .sub-menu {
        left: 0;
        top: 0;
    }
}

/* 8) 모바일 메뉴 너비 안정화 */
@media only screen and (max-width: 767px) {
    .hfe-nav-menu__breakpoint-mobile .hfe-nav-menu,
    .hfe-nav-menu__breakpoint-mobile .hfe-nav-menu li.menu-item {
        width: 100%;
    }
}

/* 9) counter 반응형 안정화 */
@media (max-width: 1024px) {
    .elementor-widget-hfe-counter .hfe-counter-wrapper[style*="row"] .hfe-counter-title,
    .elementor-widget-hfe-counter .hfe-counter-wrapper[style*="row"] .hfe-counter-content {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 767px) {
    .hfe-counter-number {
        font-size: 36px;
    }

    .hfe-counter-title {
        font-size: 16px;
    }
}