/*
 * FIHRM-AP accessible responsive navigation
 * All selectors are scoped with the fihrmap-nav prefix to avoid legacy-menu conflicts.
 */
.fihrmap-nav {
    --fihrmap-nav-bg: #fcfbf6;
    --fihrmap-nav-surface: #ffffff;
    --fihrmap-nav-surface-soft: #f3f7f5;
    --fihrmap-nav-text: #24313b;
    --fihrmap-nav-muted: #58636b;
    --fihrmap-nav-primary: #006b5b;
    --fihrmap-nav-primary-hover: #004f43;
    --fihrmap-nav-accent: #40cbb3;
    --fihrmap-nav-border: #d8dfdc;
    --fihrmap-nav-focus: #ffbf47;
    --fihrmap-nav-shadow: 0 12px 30px rgba(15, 45, 39, 0.16);
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1040;
    width: 100%;
    color: var(--fihrmap-nav-text);
    background: var(--fihrmap-nav-bg);
    border-top: 3px solid var(--fihrmap-nav-accent);
    border-bottom: 1px solid var(--fihrmap-nav-border);
    font: inherit;
    overflow: visible;
}


/*
 * Fixed-header host support:
 * If this component is included inside the theme's existing #header element,
 * JavaScript adds .fihrmap-nav-fixed-host to that outer element. This avoids
 * transformed/sticky theme ancestors breaking position: fixed.
 */
#header.fihrmap-nav-fixed-host {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 1040 !important;
    transform: none !important;
    overflow: visible !important;
}

#header.fihrmap-nav-fixed-host .fihrmap-nav {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    z-index: auto;
}

.fihrmap-nav.is-scrolled,
#header.fihrmap-nav-fixed-host.is-scrolled {
    box-shadow: 0 8px 24px rgba(15, 45, 39, 0.22);
}

.fihrmap-nav__fixed-spacer {
    width: 100%;
    height: var(--fihrmap-nav-flow-height, 142px);
    pointer-events: none;
}

html {
    scroll-padding-top: calc(var(--fihrmap-nav-fixed-offset, 142px) + 12px);
}

#AC {
    scroll-margin-top: calc(var(--fihrmap-nav-fixed-offset, 142px) + 12px);
}

.fihrmap-nav,
.fihrmap-nav *,
.fihrmap-nav *::before,
.fihrmap-nav *::after {
    box-sizing: border-box;
}

.fihrmap-nav a,
.fihrmap-nav button {
    font: inherit;
}

.fihrmap-nav a {
    color: inherit;
    text-decoration: none;
}

.fihrmap-nav button {
    color: inherit;
}

.fihrmap-nav__skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 2000;
    padding: 10px 16px;
    color: #ffffff !important;
    background: #111111;
    border-radius: 4px;
    transform: translateY(-160%);
    transition: transform 160ms ease;
}

.fihrmap-nav__skip-link:focus {
    transform: translateY(0);
}

.fihrmap-nav :where(a, button):focus-visible {
    outline: 3px solid var(--fihrmap-nav-focus);
    outline-offset: 3px;
    border-radius: 3px;
}

.fihrmap-nav__top {
    position: relative;
    z-index: 60;
    max-height: var(--fihrmap-nav-top-height, 96px);
    overflow: visible;
    opacity: 1;
    visibility: visible;
    background: var(--fihrmap-nav-bg);
    transform: translateY(0) scale(1);
    transform-origin: top center;
    will-change: max-height, opacity, transform;
    transition:
        max-height 340ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 190ms ease,
        transform 340ms cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s linear 0s;
}

@media (min-width: 1025px) {
    .fihrmap-nav.is-scrolled .fihrmap-nav__top {
        max-height: 0;
        overflow: clip;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px) scale(0.985);
        pointer-events: none;
        transition:
            max-height 340ms cubic-bezier(0.22, 1, 0.36, 1),
            opacity 170ms ease,
            transform 340ms cubic-bezier(0.22, 1, 0.36, 1),
            visibility 0s linear 340ms;
    }
}

.fihrmap-nav__top-inner {
    width: 100%;
    min-height: 76px;
    margin: 0 auto;
    padding: 10px clamp(16px, 3vw, 48px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.fihrmap-nav__brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 48px;
}

.fihrmap-nav__brand img {
    display: block;
    width: 204px;
    height: 48px;
    max-width: 100%;
    object-fit: contain;
}

.fihrmap-nav__utility-area {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    min-width: 0;
}

.fihrmap-nav__accesskey {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 44px;
    color: var(--fihrmap-nav-muted) !important;
    font-weight: 700;
    letter-spacing: 1px;
}

.fihrmap-nav__quick-nav {
    display: block;
}

.fihrmap-nav__quick-list,
.fihrmap-nav__main-list,
.fihrmap-nav__submenu,
.fihrmap-nav__mobile-quick-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fihrmap-nav__quick-list {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}

.fihrmap-nav__quick-list > li {
    position: relative;
}

.fihrmap-nav__quick-list > li > a,
.fihrmap-nav__language-button,
.fihrmap-nav__icon-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 10px;
    border: 0;
    background: transparent;
    color: var(--fihrmap-nav-text);
    cursor: pointer;
    white-space: nowrap;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.fihrmap-nav__quick-list > li > a:hover,
.fihrmap-nav__language-button:hover,
.fihrmap-nav__icon-button:hover {
    color: var(--fihrmap-nav-primary-hover);
    background: rgba(0, 107, 91, 0.08);
}

.fihrmap-nav__quick-list i,
.fihrmap-nav__language-button i,
.fihrmap-nav__icon-button i {
    color: var(--fihrmap-nav-primary);
    font-size: 1.05rem;
}

.fihrmap-nav__icon-button {
    width: 44px;
    padding: 0;
    border-radius: 50%;
}

.fihrmap-nav__chevron {
    width: 8px;
    height: 8px;
    margin-left: 3px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transform-origin: center;
    transition: transform 180ms ease;
}

[aria-expanded="true"] > .fihrmap-nav__chevron {
    transform: rotate(225deg) translate(-1px, -1px);
}

/*
 * Keep the utility row above the second navigation row while the language
 * panel is open. The top row uses transform for its collapse animation,
 * which creates a stacking context; without an explicit z-index the later
 * main row can paint over the upper part of this panel.
 */
.fihrmap-nav .fihrmap-nav__language {
    position: relative;
}

.fihrmap-nav .fihrmap-nav__language-panel {
    position: absolute !important;
    top: calc(100% + 8px);
    right: 0;
    z-index: 100;
    width: min(440px, calc(100vw - 32px));
    padding: 22px;
    color: #ffffff;
    background: #164d45;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    box-shadow: var(--fihrmap-nav-shadow);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
}

.fihrmap-nav .fihrmap-nav__language-panel.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.fihrmap-nav__language-title {
    margin: 0 0 14px;
    padding: 0 0 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
	color: #fff!important;
}

.fihrmap-nav__language-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 22px;
}

.fihrmap-nav__language-grid a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 10px;
    color: #ffffff;
    border-radius: 4px;
}

.fihrmap-nav__language-grid a:hover {
    background: rgba(255, 255, 255, 0.14);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fihrmap-nav__mobile-controls {
    display: none;
    align-items: center;
    gap: 6px;
}

.fihrmap-nav__menu-toggle {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid var(--fihrmap-nav-primary);
    border-radius: 5px;
    background: #ffffff;
    color: var(--fihrmap-nav-primary);
    cursor: pointer;
}

.fihrmap-nav__menu-toggle:hover {
    background: var(--fihrmap-nav-surface-soft);
}

.fihrmap-nav__hamburger {
    width: 24px;
    height: 18px;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
}

.fihrmap-nav__hamburger > span {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transform-origin: center;
    transition: transform 180ms ease, opacity 180ms ease;
}

.fihrmap-nav__menu-toggle[aria-expanded="true"] .fihrmap-nav__hamburger > span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.fihrmap-nav__menu-toggle[aria-expanded="true"] .fihrmap-nav__hamburger > span:nth-child(2) {
    opacity: 0;
}

.fihrmap-nav__menu-toggle[aria-expanded="true"] .fihrmap-nav__hamburger > span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.fihrmap-nav__main {
    position: relative;
    z-index: 10;
    isolation: isolate;
    border-top: 1px solid var(--fihrmap-nav-border);
    background: var(--fihrmap-nav-bg);
    transition:
        background-color 260ms ease,
        border-color 260ms ease,
        box-shadow 260ms ease;
}

.fihrmap-nav__compact-accesskey {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 44px;
    padding: 4px;
    color: var(--fihrmap-nav-muted) !important;
    font-weight: 700;
    letter-spacing: 1px;
}

@media (min-width: 1025px) {
    .fihrmap-nav.is-scrolled .fihrmap-nav__compact-accesskey:not([hidden]) {
        position: absolute;
        z-index: 4;
        top: 50%;
        left: clamp(14px, 2.4vw, 40px);
        display: inline-flex;
        opacity: 0;
        transform: translateY(-58%) scale(0.88);
        animation: fihrmap-nav-compact-accesskey-in 300ms 90ms ease-out forwards;
    }

    .fihrmap-nav.is-scrolled .fihrmap-nav__mobile-panel {
        padding-left: clamp(58px, 5vw, 82px);
    }
}

@keyframes fihrmap-nav-compact-accesskey-in {
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/*
 * 捲動精簡狀態不再於主選單中央疊加第二條裝飾線。
 * 頁首最上方只保留 .fihrmap-nav 的 3px 單一強調線，
 * 避免中央區段因偽元素重疊而看起來較粗、較暗。
 */
.fihrmap-nav__main::before {
    content: none;
}

@media (min-width: 1025px) {
    .fihrmap-nav.is-scrolled .fihrmap-nav__main {
        background: rgba(252, 251, 246, 0.96);
        border-top-color: transparent;
        box-shadow: inset 0 -1px 0 rgba(0, 107, 91, 0.08);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }

}

.fihrmap-nav__mobile-panel {
    width: 100%;
    padding: 0 clamp(16px, 3vw, 48px);
}

.fihrmap-nav__mobile-panel[hidden],
.fihrmap-nav__submenu[hidden],
.fihrmap-nav__language-panel[hidden] {
    display: none !important;
}

.fihrmap-nav__main-list {
    display: flex;
    align-items: stretch;
    gap: 2px;
}

@media (min-width: 1025px) {
    .fihrmap-nav.is-scrolled .fihrmap-nav__main-list {
        animation: fihrmap-nav-compact-row-reveal 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .fihrmap-nav.is-scrolled .fihrmap-nav__main-item {
        animation: fihrmap-nav-compact-item-settle 300ms ease-out both;
    }

    .fihrmap-nav.is-scrolled .fihrmap-nav__main-item:nth-child(2) { animation-delay: 35ms; }
    .fihrmap-nav.is-scrolled .fihrmap-nav__main-item:nth-child(3) { animation-delay: 70ms; }
    .fihrmap-nav.is-scrolled .fihrmap-nav__main-item:nth-child(4) { animation-delay: 105ms; }
    .fihrmap-nav.is-scrolled .fihrmap-nav__main-item:nth-child(5) { animation-delay: 140ms; }
}

@keyframes fihrmap-nav-compact-row-reveal {
    0% {
        opacity: 0.68;
        transform: translateY(-10px);
    }
    62% {
        opacity: 1;
        transform: translateY(2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fihrmap-nav-compact-item-settle {
    0% {
        opacity: 0.72;
        transform: translateY(-6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.fihrmap-nav__main-item {
    position: relative;
}

.fihrmap-nav__main-button {
    position: relative;
    min-height: 62px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 18px;
    border: 0;
    background: transparent;
    color: var(--fihrmap-nav-text);
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition:
        min-height 300ms cubic-bezier(0.22, 1, 0.36, 1),
        padding 300ms cubic-bezier(0.22, 1, 0.36, 1),
        color 160ms ease,
        background-color 160ms ease;
}

@media (min-width: 1025px) {
    .fihrmap-nav.is-scrolled .fihrmap-nav__main-button {
        min-height: 54px;
        padding-top: 9px;
        padding-bottom: 9px;
    }

    .fihrmap-nav.is-scrolled .fihrmap-nav__main-item + .fihrmap-nav__main-item::before {
        content: "";
        position: absolute;
        top: 50%;
        left: -1px;
        width: 1px;
        height: 22px;
        background: linear-gradient(to bottom, transparent, rgba(0, 107, 91, 0.2), transparent);
        transform: translateY(-50%);
        pointer-events: none;
    }
}

.fihrmap-nav__main-button::after {
    content: "";
    position: absolute;
    right: 18px;
    bottom: 8px;
    left: 18px;
    height: 3px;
    background: var(--fihrmap-nav-accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 180ms ease;
}

.fihrmap-nav__main-button:hover,
.fihrmap-nav__main-button[aria-expanded="true"] {
    color: var(--fihrmap-nav-primary-hover);
    background: rgba(0, 107, 91, 0.055);
}

.fihrmap-nav__main-button:hover::after,
.fihrmap-nav__main-button[aria-expanded="true"]::after,
.fihrmap-nav__main-button:focus-visible::after {
    transform: scaleX(1);
}

.fihrmap-nav__submenu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 25;
    min-width: 240px;
    max-width: min(360px, 90vw);
    padding: 8px;
    background: var(--fihrmap-nav-surface);
    border: 1px solid var(--fihrmap-nav-border);
    border-top: 3px solid var(--fihrmap-nav-accent);
    border-radius: 0 0 7px 7px;
    box-shadow: var(--fihrmap-nav-shadow);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
}

.fihrmap-nav__main-item:last-child .fihrmap-nav__submenu {
    right: 0;
    left: auto;
}

.fihrmap-nav__submenu.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.fihrmap-nav__submenu a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: 4px;
    line-height: 1.45;
    color: var(--fihrmap-nav-text);
    transition: color 150ms ease, background-color 150ms ease, padding-left 150ms ease;
}

.fihrmap-nav__submenu a:hover,
.fihrmap-nav__submenu a:focus-visible {
    color: var(--fihrmap-nav-primary-hover);
    background: var(--fihrmap-nav-surface-soft);
    padding-left: 16px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fihrmap-nav__mobile-quick-list,
.fihrmap-nav__mobile-close-wrap {
    display: none;
}

.fihrmap-nav__noscript {
    padding: 10px 16px;
    color: #111111;
    background: #fff4c2;
    border-bottom: 1px solid #caa800;
}

@media (max-width: 1199.98px) and (min-width: 1025px) {
    .fihrmap-nav__quick-list > li > a,
    .fihrmap-nav__language-button {
        padding-right: 7px;
        padding-left: 7px;
        font-size: 0.93rem;
    }

    .fihrmap-nav__main-button {
        padding-right: 13px;
        padding-left: 13px;
    }
}

@media (max-width: 1024px) {
    .fihrmap-nav__compact-accesskey {
        display: none !important;
    }

    .fihrmap-nav.is-scrolled .fihrmap-nav__mobile-panel {
        padding-left: 14px;
    }

    .fihrmap-nav.is-scrolled .fihrmap-nav__top {
        max-height: var(--fihrmap-nav-top-height, 96px);
        overflow: visible;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
    }

    .fihrmap-nav__fixed-spacer {
        height: var(--fihrmap-nav-flow-height, 70px);
    }

    html {
        scroll-padding-top: calc(var(--fihrmap-nav-fixed-offset, 70px) + 12px);
    }

    #AC {
        scroll-margin-top: calc(var(--fihrmap-nav-fixed-offset, 70px) + 12px);
    }

    .fihrmap-nav__top-inner {
        min-height: 68px;
        padding: 8px 14px;
        gap: 10px;
    }

    .fihrmap-nav__brand img {
        width: min(204px, calc(100vw - 176px));
        height: auto;
        max-height: 48px;
    }

    .fihrmap-nav__utility-area {
        gap: 4px;
    }

    .fihrmap-nav__accesskey {
        min-width: 26px;
        padding: 0 2px;
        font-size: 0.88rem;
    }

    .fihrmap-nav__quick-nav {
        display: none;
    }

    .fihrmap-nav__mobile-controls {
        display: flex;
    }

    .fihrmap-nav__menu-toggle-text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .fihrmap-nav__main {
        max-height: calc(100vh - var(--fihrmap-nav-fixed-offset, 70px));
        max-height: calc(100dvh - var(--fihrmap-nav-fixed-offset, 70px));
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-gutter: stable;
        border-top: 1px solid var(--fihrmap-nav-border);
    }

    .fihrmap-nav__mobile-panel {
        padding: 10px 14px 18px;
        background: var(--fihrmap-nav-bg);
        opacity: 0;
        transform: translateY(-10px);
        transform-origin: top;
        transition: opacity 180ms ease, transform 180ms ease;
    }

    .fihrmap-nav__mobile-panel.is-open {
        opacity: 1;
        transform: translateY(0);
    }

    .fihrmap-nav__main-list {
        display: block;
    }

    .fihrmap-nav__main-item {
        border-bottom: 1px solid var(--fihrmap-nav-border);
    }

    .fihrmap-nav__main-button {
        width: 100%;
        min-height: 52px;
        justify-content: space-between;
        padding: 11px 12px;
        text-align: left;
        white-space: normal;
    }

    .fihrmap-nav__main-button::after {
        right: auto;
        bottom: 0;
        left: 12px;
        width: 46px;
    }

    .fihrmap-nav__submenu {
        position: static;
        min-width: 0;
        max-width: none;
        margin: 0 0 10px;
        padding: 6px 8px 6px 14px;
        border: 0;
        border-left: 4px solid var(--fihrmap-nav-accent);
        border-radius: 0 5px 5px 0;
        box-shadow: none;
        background: var(--fihrmap-nav-surface-soft);
        transform: translateY(-5px);
    }

    .fihrmap-nav__submenu.is-open {
        transform: translateY(0);
    }

    .fihrmap-nav__submenu a {
        padding: 9px 10px;
    }

    .fihrmap-nav__submenu a:hover,
    .fihrmap-nav__submenu a:focus-visible {
        padding-left: 14px;
        background: #ffffff;
    }

    .fihrmap-nav__mobile-quick-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid var(--fihrmap-nav-border);
    }

    .fihrmap-nav__mobile-quick-list a {
        min-height: 48px;
        display: flex;
        align-items: center;
        gap: 9px;
        padding: 9px 11px;
        background: #ffffff;
        border: 1px solid var(--fihrmap-nav-border);
        border-radius: 5px;
    }

    .fihrmap-nav__mobile-quick-list a:hover {
        color: var(--fihrmap-nav-primary-hover);
        background: var(--fihrmap-nav-surface-soft);
        text-decoration: underline;
        text-underline-offset: 3px;
    }

    .fihrmap-nav__mobile-quick-list i {
        width: 20px;
        color: var(--fihrmap-nav-primary);
        text-align: center;
    }

    .fihrmap-nav__mobile-close-wrap {
        display: flex;
        justify-content: center;
        margin-top: 18px;
    }

    .fihrmap-nav__mobile-close {
        min-width: 170px;
        min-height: 46px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 9px;
        padding: 10px 22px;
        color: var(--fihrmap-nav-primary);
        background: #ffffff;
        border: 1px solid var(--fihrmap-nav-primary);
        border-radius: 7px;
        font-weight: 700;
        cursor: pointer;
        transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
    }

    .fihrmap-nav__mobile-close:hover {
        color: #ffffff;
        background: var(--fihrmap-nav-primary);
        transform: translateY(-2px);
    }
}

@media (max-width: 480px) {
    .fihrmap-nav__mobile-quick-list {
        grid-template-columns: 1fr;
    }

    .fihrmap-nav__top-inner {
        padding-right: 8px;
        padding-left: 8px;
    }

    .fihrmap-nav__brand img {
        width: min(170px, calc(100vw - 154px));
    }
}


/* ========================================================================== 
 * 2026-07 polished interaction layer
 * - compact logo after scrolling
 * - unified utility icons
 * - submenu accent line expands from the centre
 * - softer compact header and richer submenu surfaces
 * ========================================================================== */
.fihrmap-nav {
    --fihrmap-nav-shadow: 0 14px 34px rgba(15, 45, 39, 0.14);
}

.fihrmap-nav.is-scrolled,
#header.fihrmap-nav-fixed-host.is-scrolled {
    box-shadow: 0 5px 18px rgba(15, 45, 39, 0.10);
}

/* The compact home link is available only while the desktop header is collapsed. */
.fihrmap-nav__compact-brand {
    display: none;
}

/* Remove the line beneath a primary item. The animated line now belongs to
   the submenu panel itself, so the visual hierarchy is clearer. */
.fihrmap-nav__main-button::after {
    content: none !important;
}

.fihrmap-nav__main-button:hover,
.fihrmap-nav__main-button:focus-visible,
.fihrmap-nav__main-button[aria-expanded="true"] {
    color: var(--fihrmap-nav-primary-hover);
    background: linear-gradient(
        180deg,
        rgba(64, 203, 179, 0.08),
        rgba(0, 107, 91, 0.045)
    );
    border-radius: 7px;
}

/* Consistent icon rhythm for the desktop utility row. */
.fihrmap-nav__quick-list > li > a,
.fihrmap-nav__language-button,
.fihrmap-nav__icon-button {
    gap: 8px;
    border-radius: 8px;
}

.fihrmap-nav__quick-list > li > a > i,
.fihrmap-nav__language-button > i,
.fihrmap-nav__icon-button > i {
    inline-size: 30px;
    block-size: 30px;
    flex: 0 0 30px;
    display: inline-grid;
    place-items: center;
    margin: 0;
    color: var(--fihrmap-nav-primary);
    background: rgba(0, 107, 91, 0.075);
    border: 1px solid rgba(0, 107, 91, 0.08);
    border-radius: 50%;
    font-size: 0.93rem;
    line-height: 1;
    transition:
        color 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        transform 180ms ease;
}

.fihrmap-nav__quick-list > li > a:hover > i,
.fihrmap-nav__quick-list > li > a:focus-visible > i,
.fihrmap-nav__language-button:hover > i,
.fihrmap-nav__language-button:focus-visible > i,
.fihrmap-nav__language-button[aria-expanded="true"] > i,
.fihrmap-nav__icon-button:hover > i,
.fihrmap-nav__icon-button:focus-visible > i {
    color: #ffffff;
    background: var(--fihrmap-nav-primary);
    border-color: var(--fihrmap-nav-primary);
    transform: translateY(-1px);
}

.fihrmap-nav__icon-button {
    width: 46px;
    padding: 7px;
    border-radius: 8px;
}

/* A slightly slower easing makes both language and content panels feel less abrupt. */
.fihrmap-nav .fihrmap-nav__language-panel {
    transform: translateY(10px) scale(0.985);
    transform-origin: top right;
    transition:
        opacity 220ms ease,
        transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 240ms ease;
    will-change: opacity, transform;
}

.fihrmap-nav .fihrmap-nav__language-panel.is-open {
    transform: translateY(0) scale(1);
}

@media (min-width: 1025px) {
    .fihrmap-nav.is-scrolled .fihrmap-nav__main {
        background: rgba(252, 251, 246, 0.93);
        border-top-color: transparent;
        box-shadow: inset 0 -1px 0 rgba(0, 107, 91, 0.07);
        -webkit-backdrop-filter: blur(12px) saturate(1.08);
        backdrop-filter: blur(12px) saturate(1.08);
    }

    .fihrmap-nav.is-scrolled .fihrmap-nav__compact-brand {
        position: absolute;
        z-index: 5;
        top: 50%;
        left: clamp(52px, 4.5vw, 72px);
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 5px 7px;
        border-radius: 7px;
        opacity: 0;
        transform: translate(-8px, -50%);
        animation: fihrmap-nav-compact-brand-in 320ms 60ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
    }

    .fihrmap-nav.is-scrolled .fihrmap-nav__compact-brand:hover,
    .fihrmap-nav.is-scrolled .fihrmap-nav__compact-brand:focus-visible {
        background: rgba(0, 107, 91, 0.065);
    }

    .fihrmap-nav__compact-brand img {
        display: block;
        width: clamp(116px, 10vw, 136px);
        height: auto;
        max-height: 32px;
        object-fit: contain;
    }

    .fihrmap-nav.is-scrolled .fihrmap-nav__mobile-panel {
        padding-left: clamp(205px, 18vw, 270px);
    }

    /* Desktop submenu card */
    .fihrmap-nav__submenu {
        overflow: visible;
        padding: 11px;
        background:
            linear-gradient(145deg, rgba(255, 255, 255, 0.995), rgba(242, 249, 246, 0.98));
        border: 1px solid rgba(0, 107, 91, 0.16);
        border-top: 0;
        border-radius: 0 0 11px 11px;
        box-shadow:
            0 16px 34px rgba(15, 45, 39, 0.14),
            0 3px 9px rgba(15, 45, 39, 0.07);
        opacity: 0;
        transform: translateY(10px) scale(0.985);
        transform-origin: top center;
        pointer-events: none;
        transition:
            opacity 210ms ease,
            transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
            box-shadow 240ms ease;
        will-change: opacity, transform;
    }

    /* The submenu line expands from the centre, instead of appearing below
       the primary button label. */
    .fihrmap-nav__submenu::before {
        content: "";
        position: absolute;
        z-index: 1;
        top: 0;
        right: 0;
        left: 0;
        height: 3px;
        background: linear-gradient(
            90deg,
            var(--fihrmap-nav-primary),
            var(--fihrmap-nav-accent),
            var(--fihrmap-nav-primary)
        );
        border-radius: 3px 3px 0 0;
        transform: scaleX(0);
        transform-origin: center;
        transition: transform 260ms 30ms cubic-bezier(0.22, 1, 0.36, 1);
        pointer-events: none;
    }

    .fihrmap-nav__submenu.is-open {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

    .fihrmap-nav__submenu.is-open::before {
        transform: scaleX(1);
    }

    .fihrmap-nav__submenu > li {
        position: relative;
    }

    .fihrmap-nav__submenu > li + li {
        margin-top: 3px;
        padding-top: 3px;
        border-top: 1px solid rgba(0, 107, 91, 0.085);
    }

    .fihrmap-nav__submenu a {
        position: relative;
        min-height: 46px;
        padding: 10px 14px 10px 36px;
        border: 1px solid transparent;
        border-radius: 7px;
        line-height: 1.48;
        transition:
            color 170ms ease,
            background-color 170ms ease,
            border-color 170ms ease,
            box-shadow 170ms ease,
            transform 170ms ease;
    }

    .fihrmap-nav__submenu a::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 15px;
        width: 9px;
        height: 9px;
        border: 2px solid var(--fihrmap-nav-accent);
        border-radius: 50%;
        background: transparent;
        transform: translateY(-50%);
        transition:
            background-color 170ms ease,
            border-color 170ms ease,
            box-shadow 170ms ease,
            transform 170ms ease;
    }

    .fihrmap-nav__submenu a:hover,
    .fihrmap-nav__submenu a:focus-visible {
        color: var(--fihrmap-nav-primary-hover);
        background: linear-gradient(
            90deg,
            rgba(64, 203, 179, 0.16),
            rgba(0, 107, 91, 0.045)
        );
        border-color: rgba(0, 107, 91, 0.11);
        box-shadow: inset 3px 0 0 var(--fihrmap-nav-accent);
        padding-left: 36px;
        text-decoration: none;
        transform: translateX(2px);
    }

    .fihrmap-nav__submenu a:hover::before,
    .fihrmap-nav__submenu a:focus-visible::before {
        background: var(--fihrmap-nav-primary);
        border-color: var(--fihrmap-nav-primary);
        box-shadow: 0 0 0 3px rgba(64, 203, 179, 0.18);
        transform: translateY(-50%) scale(1.05);
    }
}

@keyframes fihrmap-nav-compact-brand-in {
    to {
        opacity: 1;
        transform: translate(0, -50%);
    }
}

@media (max-width: 1024px) {
    /* Keep the mobile submenu visually related to the desktop card without
       making the accordion heavy. */
    .fihrmap-nav__submenu {
        background: linear-gradient(135deg, #f6fbf9, #eef7f3);
        border-left-color: var(--fihrmap-nav-primary);
    }

    .fihrmap-nav__submenu > li + li {
        border-top: 1px solid rgba(0, 107, 91, 0.09);
    }

    .fihrmap-nav__submenu a {
        position: relative;
        padding-left: 32px;
        border-radius: 6px;
    }

    .fihrmap-nav__submenu a::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 12px;
        width: 8px;
        height: 8px;
        border: 2px solid var(--fihrmap-nav-accent);
        border-radius: 50%;
        transform: translateY(-50%);
    }

    .fihrmap-nav__submenu a:hover,
    .fihrmap-nav__submenu a:focus-visible {
        padding-left: 32px;
        text-decoration: none;
        box-shadow: inset 3px 0 0 var(--fihrmap-nav-accent);
    }

    .fihrmap-nav__mobile-quick-list i {
        inline-size: 30px;
        block-size: 30px;
        flex: 0 0 30px;
        display: inline-grid;
        place-items: center;
        color: var(--fihrmap-nav-primary);
        background: rgba(0, 107, 91, 0.075);
        border: 1px solid rgba(0, 107, 91, 0.08);
        border-radius: 50%;
        font-size: 0.93rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    @media (min-width: 1025px) {
        .fihrmap-nav.is-scrolled .fihrmap-nav__main-list,
        .fihrmap-nav.is-scrolled .fihrmap-nav__main-item,
        .fihrmap-nav.is-scrolled .fihrmap-nav__compact-accesskey {
            animation: none !important;
            opacity: 1;
        }
    }

    .fihrmap-nav *,
    .fihrmap-nav *::before,
    .fihrmap-nav *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (forced-colors: active) {
    .fihrmap-nav__main-button::after {
        background: CanvasText;
    }

    .fihrmap-nav__submenu,
    .fihrmap-nav__language-panel,
    .fihrmap-nav__mobile-quick-list a {
        border: 1px solid CanvasText;
    }
}


/* ========================================================================== 
 * 2026-07 typography and hover refinement
 * - stronger primary navigation labels
 * - quieter submenu hover while retaining colour cues
 * - slightly smaller desktop utility labels
 * - relative font units for scalable text
 * ========================================================================== */

/* Primary navigation labels are intentionally bold. 1rem follows the root
   text size and remains predictable when the browser text size is changed. */
.fihrmap-nav__main-button {
    font-size: 1.1rem!important;
    font-weight: 700!important;
}

/* Slightly reduce only the desktop utility text. Icons retain their existing
   dimensions and the 44px minimum target size is unchanged. */
@media (min-width: 1025px) {
    .fihrmap-nav__quick-list > li > a,
    .fihrmap-nav__language-button {
        font-size: 0.9375rem;
        line-height: 1.4;
    }
}

/* Keep submenu typography unchanged. Mouse hover now changes only the text
   and leading circle; remove movement, fills, borders and inset accents. */
.fihrmap-nav__submenu a:hover {
    color: var(--fihrmap-nav-primary-hover);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    padding-left: 36px;
    text-decoration: none;
    transform: none;
}

.fihrmap-nav__submenu a:hover::before {
    background: var(--fihrmap-nav-primary);
    border-color: var(--fihrmap-nav-primary);
    box-shadow: none;
    transform: translateY(-50%);
}

/* Keyboard focus must remain visually obvious for accessibility. It uses an
   outline rather than the removed mouse-hover animation. */
.fihrmap-nav__submenu a:focus-visible {
    color: var(--fihrmap-nav-primary-hover);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    padding-left: 36px;
    text-decoration: none;
    transform: none;
    outline: 3px solid rgba(0, 107, 91, 0.72);
    outline-offset: 2px;
}

.fihrmap-nav__submenu a:focus-visible::before {
    background: var(--fihrmap-nav-primary);
    border-color: var(--fihrmap-nav-primary);
    box-shadow: none;
    transform: translateY(-50%);
}

@media (max-width: 1024px) {
    .fihrmap-nav__submenu a:hover,
    .fihrmap-nav__submenu a:focus-visible {
        padding-left: 32px;
    }
}

/* ========================================================================== 
 * 2026-07 desktop submenu auto-width
 * - let each desktop submenu grow to the width of its longest item
 * - keep submenu labels on one line on desktop
 * - retain normal wrapping on mobile to avoid horizontal scrolling
 * ========================================================================== */
@media (min-width: 1025px) {
    .fihrmap-nav__submenu {
        width: max-content;
        min-width: 140px;
        max-width: calc(100vw - 32px);
    }

    .fihrmap-nav__submenu a {
        white-space: nowrap;
    }

    /* Right-align the final two menus so a wider panel is less likely to
       extend beyond the viewport edge. */
    .fihrmap-nav__main-item:nth-last-child(-n + 2) .fihrmap-nav__submenu {
        right: 0;
        left: auto;
    }
}

/* ========================================================================== 
 * 2026-08-05 搜尋視窗完整顯示修正
 *
 * 網站舊樣式仍有最高 9,999,999 的圖層。搜尋 Modal 被移到 body 後，
 * 僅針對 #searchModal 使用更高且封閉的圖層，確保在 801px、手機版、
 * 瀏覽器放大等狀態下，都不會被橫幅或下方首頁內容截斷。
 * ========================================================================== */
body > #searchModal.modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    z-index: 10000001 !important;
}

body > #searchModal.modal.show {
    display: block !important;
    pointer-events: auto !important;
}

body > #searchModal .modal-dialog {
    position: relative !important;
    z-index: 1 !important;
    width: auto;
    max-width: 500px;
    margin-right: auto;
    margin-left: auto;
}

body > #searchModal .modal-content {
    position: relative;
    z-index: 1;
    max-height: calc(100dvh - 2rem);
    overflow: auto;
}

body > .modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    z-index: 10000000 !important;
    pointer-events: auto !important;
}

@media (max-width: 1024px) {
    body > #searchModal .modal-dialog {
        width: calc(100% - 1.5rem);
        max-width: 500px;
        min-height: calc(100% - 1.5rem);
        margin: 0.75rem auto;
    }

    body > #searchModal .modal-content {
        max-height: calc(100dvh - 1.5rem);
    }
}



/* ==========================================================================
 * 2026-08-10 站內搜尋視窗視覺優化
 * 僅作用於 #searchModal，不影響其他 Bootstrap Modal。
 * 焦點管理：開啟後先聚焦關閉按鈕，Tab 依序進入搜尋欄位與搜尋按鈕；關閉後回到觸發按鈕。
 * ========================================================================== */
body > #searchModal .modal-dialog {
    max-width: 560px;
}

body > #searchModal .fihrmap-search-modal__content {
    overflow: hidden;
    color: #24313b;
    background: #ffffff;
    border: 1px solid #d8dfdc;
    border-top: 5px solid #017e67;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15, 45, 39, 0.28);
}

body > #searchModal .fihrmap-search-modal__header {
    min-height: 76px;
    padding: 16px 22px 16px 24px;
    background: #fcfbf6;
    border-bottom: 1px solid #e1e7e4;
}

body > #searchModal .fihrmap-search-modal__title-group {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

body > #searchModal .fihrmap-search-modal__title-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #017e67;
    background: rgba(1, 126, 103, 0.10);
    border-radius: 50%;
}

body > #searchModal .fihrmap-search-modal__title-icon i {
    font-size: 1rem;
}

body > #searchModal .fihrmap-search-modal__title {
    margin: 0;
    color: #111111;
    font-size: 1.35rem;
    font-weight: 750;
    line-height: 1.3;
}

body > #searchModal .fihrmap-search-modal__close {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    margin: 0 0 0 auto !important;
    padding: 0.75rem;
    border-radius: 50%;
    opacity: 0.72;
    transition: background-color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

body > #searchModal .fihrmap-search-modal__close:hover {
    background-color: rgba(1, 126, 103, 0.10);
    opacity: 1;
}

body > #searchModal .fihrmap-search-modal__close:focus-visible {
    outline: 3px solid #017e67 !important;
    outline-offset: 2px;
    opacity: 1;
}

body > #searchModal .fihrmap-search-modal__body {
    padding: 26px 24px 18px;
}

body > #searchModal .fihrmap-search-modal__label {
    display: block;
    margin: 0 0 10px;
    color: #25332f;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
}

body > #searchModal .fihrmap-search-modal__input-wrap {
    position: relative;
}

body > #searchModal .fihrmap-search-modal__input-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    z-index: 2;
    color: #017e67;
    font-size: 1rem;
    pointer-events: none;
    transform: translateY(-50%);
}

body > #searchModal .fihrmap-search-modal__input {
    width: 100%;
    height: 56px;
    min-height: 56px;
    padding: 0 16px 0 46px !important;
    color: #24313b;
    background: #ffffff !important;
    border: 1px solid #9fb0aa !important;
    border-radius: 10px !important;
    font-size: 1rem !important;
    line-height: 1.4;
    box-shadow: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

body > #searchModal .fihrmap-search-modal__input::placeholder {
    color: #66726d !important;
    opacity: 1;
}

body > #searchModal .fihrmap-search-modal__input:hover {
    border-color: #718b82 !important;
}

body > #searchModal .fihrmap-search-modal__input:focus,
body > #searchModal .fihrmap-search-modal__input:focus-visible {
    border-color: #017e67 !important;
    outline: 3px solid #017e67 !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(1, 126, 103, 0.12) !important;
}

body > #searchModal .fihrmap-search-modal__footer {
    display: flex;
    justify-content: flex-end;
    padding: 0 24px 24px;
    background: #ffffff;
    border-top: 0;
}

body > #searchModal .fihrmap-search-modal__submit {
    min-width: 126px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 22px;
    color: #ffffff !important;
    background: #017e67 !important;
    border: 2px solid #017e67 !important;
    border-radius: 8px !important;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 8px 18px rgba(1, 126, 103, 0.20);
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

body > #searchModal .fihrmap-search-modal__submit:hover {
    color: #ffffff !important;
    background: #005f50 !important;
    border-color: #005f50 !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0, 95, 80, 0.24);
}

body > #searchModal .fihrmap-search-modal__submit:focus-visible {
    outline: 3px solid #017e67 !important;
    outline-offset: 3px;
}

@media (max-width: 576px) {
    body > #searchModal .modal-dialog {
        width: calc(100% - 1rem);
        min-height: calc(100% - 1rem);
        margin: 0.5rem auto;
    }

    body > #searchModal .fihrmap-search-modal__content {
        max-height: calc(100dvh - 1rem);
        border-radius: 14px;
    }

    body > #searchModal .fihrmap-search-modal__header {
        min-height: 68px;
        padding: 13px 14px 13px 16px;
    }

    body > #searchModal .fihrmap-search-modal__title-group {
        gap: 10px;
    }

    body > #searchModal .fihrmap-search-modal__title-icon {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
    }

    body > #searchModal .fihrmap-search-modal__title {
        font-size: 1.2rem;
    }

    body > #searchModal .fihrmap-search-modal__close {
        width: 40px;
        height: 40px;
        margin-left: auto !important;
    }

    body > #searchModal .fihrmap-search-modal__body {
        padding: 22px 16px 16px;
    }

    body > #searchModal .fihrmap-search-modal__input {
        height: 54px;
        min-height: 54px;
    }

    body > #searchModal .fihrmap-search-modal__footer {
        padding: 0 16px 18px;
    }

    body > #searchModal .fihrmap-search-modal__submit {
        width: 100%;
        min-height: 50px;
    }
}
