/* ============================================================
   Liquid-glass navbar — shared across every page (header-glass.blade.php).
   Loaded after theme-light.css in styles.blade.php, so it wins the
   cascade without touching vendor main.css. Deliberately does NOT reuse
   .header-transparent/.tp-header-* rules from main.css: this navbar is
   always-visible frosted glass (fixed, floating island), not the old
   transparent-over-hero-then-sticky-on-scroll pattern -- that pattern is
   also what made nav text (forced white in main.css) invisible on pages
   with no dark hero directly under the header (login, dashboard, about,
   etc.). Paired with header-glass.js, which only toggles a size/blur
   "condense" class on scroll -- no background swap needed anymore.
   ============================================================ */

:root {
    --tkf-nav-radius: 36px;
    --tkf-nav-inset: clamp(12px, 3vw, 28px);
    --tkf-nav-top: clamp(10px, 2vw, 18px);
    --tkf-nav-glass-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.56));
    --tkf-nav-glass-border: rgba(255, 255, 255, 0.55);
    --tkf-nav-text: #16181C;
    --tkf-nav-accent: #E31E24;
    --tkf-nav-accent-hover: #C81A20;
}

.tkf-navbar {
    position: fixed;
    top: var(--tkf-nav-top);
    left: 50%;
    z-index: 500;
    width: max-content;
    max-width: min(1080px, calc(100vw - var(--tkf-nav-inset) * 2));
    transform: translateX(-50%);
    transition: top 0.35s ease, box-shadow 0.35s ease;
}

.tkf-navbar__inner {
    justify-content: space-between;
    gap: 16px;
    padding: 6px 14px;
    border-radius: var(--tkf-nav-radius);
    background: var(--tkf-nav-glass-bg);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--tkf-nav-glass-border);
    box-shadow:
        0 18px 48px rgba(24, 31, 42, 0.12),
        0 2px 8px rgba(24, 31, 42, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        inset 0 -1px 0 rgba(15, 15, 20, 0.04);
    transition: padding 0.35s ease, border-radius 0.35s ease, box-shadow 0.35s ease;
}

/* Condensed state -- toggled by header-glass.js once the page has scrolled
   past a small threshold. Same glass, slightly tighter + a firmer shadow so
   the bar reads as "settled" rather than jumping to a different look. */
.tkf-navbar.is-condensed {
    top: calc(var(--tkf-nav-top) * 0.5);
}
.tkf-navbar.is-condensed .tkf-navbar__inner {
    padding-top: 4px;
    padding-bottom: 4px;
    box-shadow:
        0 14px 38px rgba(15, 15, 20, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        inset 0 -1px 0 rgba(15, 15, 20, 0.04);
}

/* ---------- Logo ---------- */
.tkf-navbar__logo {
    flex: 0 0 auto;
}
.tkf-navbar__logo-img {
    display: block;
    height: 34px;
    width: auto;
}

/* ---------- Nav menu ---------- */
.tkf-navbar__menu {
    flex: 1 1 auto;
    justify-content: center;
}
.tkf-navbar__menu nav > ul {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}
.tkf-navbar__menu nav > ul > li {
    list-style: none;
    margin: 0 2px;
    position: relative;
}
.tkf-navbar__menu nav > ul > li > a {
    display: inline-block;
    padding: 10px 11px;
    border-radius: 16px;
    font-weight: 500;
    font-size: clamp(13px, 1.05vw, 16px);
    letter-spacing: -0.01em;
    color: var(--tkf-nav-text);
    position: relative;
    transition: color 0.2s ease, background-color 0.2s ease;
}
.tkf-navbar__menu nav > ul > li > a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 3px;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--tkf-nav-accent);
    transform: translateX(-50%) scaleX(0);
    transition: transform 0.2s ease;
}
.tkf-navbar__menu nav > ul > li:hover > a,
.tkf-navbar__menu nav > ul > li:focus-within > a {
    color: var(--tkf-nav-accent);
    background: rgba(227, 30, 36, 0.075);
}
.tkf-navbar__menu nav > ul > li:focus-within > a::after {
    transform: translateX(-50%) scaleX(1);
}
.tkf-navbar__menu nav > ul > li.has-dropdown > a {
    padding-right: 25px;
}
.tkf-navbar__menu nav > ul > li.has-dropdown > a::before {
    content: "";
    position: absolute;
    right: 11px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.25s ease;
}
.tkf-navbar__menu nav > ul > li.has-dropdown:hover > a::before {
    transform: translateY(-30%) rotate(225deg);
}
.tkf-navbar__menu nav > ul > li.has-dropdown:focus-within > a::before {
    transform: translateY(-30%) rotate(225deg);
}

/* ---------- Dropdown ---------- */
.tkf-navbar__menu .tp-submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 240px;
    margin: 0;
    /* padding, not margin/gap, so the invisible strip above the panel is
       still part of the hover target -- keeps :hover continuous between
       the parent link and the dropdown instead of a dead gap closing it. */
    padding: 14px 8px 8px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 10;
}
.tkf-navbar__menu nav > ul > li:hover > .tp-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.tkf-navbar__menu nav > ul > li:focus-within > .tp-submenu,
.tkf-navbar__menu .tp-submenu li:focus-within > .tp-submenu {
    opacity: 1;
    visibility: visible;
}
.tkf-navbar__menu .tp-submenu::before {
    content: "";
    position: absolute;
    inset: 6px 0 0 0;
    border-radius: 18px;
    background: var(--tkf-nav-glass-bg);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--tkf-nav-glass-border);
    box-shadow: 0 16px 36px rgba(15, 15, 20, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.65);
    z-index: -1;
}
.tkf-navbar__menu .tp-submenu li {
    list-style: none;
}
.tkf-navbar__menu .tp-submenu li a {
    display: block;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--tkf-nav-text);
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
}
.tkf-navbar__menu .tp-submenu li a:hover {
    background: rgba(227, 30, 36, 0.08);
    color: var(--tkf-nav-accent);
}
.tkf-navbar__menu .tp-submenu li a:focus-visible {
    background: rgba(227, 30, 36, 0.08);
    color: var(--tkf-nav-accent);
}
.tkf-navbar__menu .tp-submenu .tp-submenu {
    top: 0;
    left: 100%;
    transform: translateX(8px);
}
.tkf-navbar__menu .tp-submenu li:hover > .tp-submenu,
.tkf-navbar__menu .tp-submenu li:focus-within > .tp-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(4px);
}

/* ---------- Actions (ministry logo + mobile burger) ---------- */
.tkf-navbar__actions {
    flex: 0 0 auto;
    gap: 10px;
}
.tkf-navbar__gsb-img {
    height: 30px;
    width: auto;
}

.tkf-navbar__burger {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(15, 15, 20, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
}
.tkf-navbar__burger i {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--tkf-nav-text);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease, width 0.2s ease;
}
.tkf-navbar__burger:hover i:nth-child(2) {
    width: 12px;
}

.tkf-navbar a:focus-visible,
.tkf-navbar button:focus-visible {
    outline: 2px solid var(--tkf-nav-accent);
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .tkf-navbar,
    .tkf-navbar__inner,
    .tkf-navbar a,
    .tkf-navbar__menu .tp-submenu,
    .tkf-navbar__burger i {
        transition-duration: 0.01ms;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
    .tkf-navbar {
        width: calc(100% - var(--tkf-nav-inset) * 2);
    }
    .tkf-navbar__inner {
        padding: 8px 10px 8px 16px;
    }
    .tkf-navbar__logo-img {
        height: 32px;
    }
    .tkf-navbar__gsb-img {
        height: 28px;
    }
}

@media (max-width: 767px) {
    :root {
        --tkf-nav-radius: 28px;
    }
    .tkf-navbar {
        width: calc(100% - 24px);
        top: 10px;
    }
}
