/* ARTKJIN Header Actions UI 1.0.2 — 기존 헤더/로고/메인 메뉴에는 개입하지 않습니다. */

header .akhn-actions,
.artkjin-shared-header .akhn-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end;
    gap: 8px !important;
    flex-wrap: wrap;
    min-width: 0;
}

header a.akhn-button,
.artkjin-shared-header a.akhn-button {
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center;
    gap: 7px !important;
    min-height: 40px;
    padding: 9px 12px !important;
    margin: 0 !important;
    border: 1px solid #e3e3df !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    color: #292b29 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    letter-spacing: -.02em;
    white-space: nowrap !important;
    text-decoration: none !important;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

header a.akhn-button:hover,
.artkjin-shared-header a.akhn-button:hover {
    border-color: #bfc6be !important;
    background: #f5f7f3 !important;
    box-shadow: 0 1px 4px rgba(33, 39, 33, .05);
    text-decoration: none !important;
}

header a.akhn-button:focus-visible,
header a.akhn-logout:focus-visible,
.artkjin-shared-header a.akhn-button:focus-visible,
.artkjin-shared-header a.akhn-logout:focus-visible {
    outline: 2px solid #647a69 !important;
    outline-offset: 3px !important;
}

header .akhn-icon,
.artkjin-shared-header .akhn-icon {
    display: inline-flex;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

header .akhn-icon svg,
.artkjin-shared-header .akhn-icon svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 눈에 덜 띄는 보조 행동. 우선순위: 마이페이지/장바구니 > 로그아웃. */
header a.akhn-logout,
.artkjin-shared-header a.akhn-logout {
    display: inline-flex !important;
    align-items: center;
    min-height: 38px;
    margin: 0 !important;
    padding: 6px 12px 6px 2px !important;
    border: 0 !important;
    border-right: 1px solid #e1e3dd !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #848981 !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
}

header a.akhn-logout:hover,
.artkjin-shared-header a.akhn-logout:hover {
    color: #303a32 !important;
    text-decoration: underline !important;
}

header .akhn-separator,
.artkjin-shared-header .akhn-separator {
    display: none !important;
}

/* 오른쪽 그룹을 감쌀 수 없는 테마에서도 링크 사이의 간격을 확보 */
header a.akhn-button.akhn-ungrouped {
    margin-left: 8px !important;
}

/* 기존 워드프레스 블록 내비게이션의 li 기본 정렬만 보정 */
header .akhn-actions > .wp-block-navigation-item,
header .akhn-actions > li {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

@media (max-width: 1100px) {
    header .akhn-actions,
    .artkjin-shared-header .akhn-actions {
        gap: 5px !important;
    }
    header a.akhn-button,
    .artkjin-shared-header a.akhn-button {
        min-height: 38px;
        padding: 8px 9px !important;
        font-size: 13px !important;
    }
}

/* 782px 이하는 기존 모바일 드로어를 유지. 숨겨진 메뉴나 네비게이션 버튼은 손대지 않음 */
@media (max-width: 782px) {
    header .akhn-actions,
    .artkjin-shared-header .akhn-actions {
        gap: 8px !important;
        justify-content: flex-start;
    }
    header a.akhn-button,
    .artkjin-shared-header a.akhn-button {
        min-height: 38px;
        padding: 8px 10px !important;
        font-size: 13px !important;
    }
    header a.akhn-logout,
    .artkjin-shared-header a.akhn-logout {
        min-height: 36px;
    }
    header .wp-block-navigation__responsive-container.is-menu-open .akhn-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    header a.akhn-button,
    .artkjin-shared-header a.akhn-button {
        transition: none;
    }
}

/* 1.0.1 — 모바일 로그인/로그아웃 중복 제거 (데스크톱 영향 없음) */
@media (max-width: 782px) {
    header .wp-block-navigation__responsive-container .akhn-mobile-auth-duplicate,
    header .wp-block-navigation__responsive-container .akhn-mobile-auth-duplicate-item {
        display: none !important;
    }
    header .wp-block-navigation__responsive-container.is-menu-open
    .akhn-mobile-auth-primary-item {
        display: flex !important;
    }
    header .wp-block-navigation__responsive-container.is-menu-open
    .akhn-mobile-auth-primary-item > a.akhn-mobile-auth-primary,
    header .wp-block-navigation__responsive-container .artkjin-mobile-drawer-actions
    a.akhn-mobile-auth-primary {
        display: inline-flex !important;
        align-items: center !important;
    }
}

/* v1.0.2: header 밖에서 렌더된 모바일 내비게이션까지 정리 */
@media (max-width: 782px) {
    .akhn-auth-suppressed,
    a.akhn-auth-suppressed,
    .akhn-auth-suppressed-item,
    header .akhn-auth-suppressed,
    .wp-block-navigation__responsive-container .akhn-auth-suppressed,
    .artkjin-mobile-drawer-actions .akhn-auth-suppressed {
        display: none !important;
        visibility: hidden !important;
    }
    .artkjin-mobile-drawer-actions a.akhn-auth-canonical {
        display: inline-flex !important;
        visibility: visible !important;
    }
}
