/* geopark.kg — modern site header (parts/menu.php + js/header.js).
   Overrides the theme's global header/nav rules inside #amd-header. */

:root {
    --hdr-gold: #c18a0b;
    --hdr-gold-dark: #8f6608;
    --hdr-navy: #1e2b3a;
    --hdr-ink: #1f1f1f;
    --hdr-bar: 38px;
    --hdr-main: 80px;
    --amd-head: calc(var(--hdr-bar) + var(--hdr-main));
}

/* The page templates wrap the menu in <header>; neutralise the old fixed green header. */
body > header { position: static; display: block; background: none; box-shadow: none; }

#amd-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.3;
}
body.admin-bar #amd-header { top: 32px; }
#amd-header *, #amd-header *::before, #amd-header *::after { box-sizing: border-box; }
#amd-header a { font-weight: inherit; text-decoration: none; }
#amd-header ul { margin: 0; padding: 0; list-style: none; }
.amd-hdr__in { display: flex; align-items: center; gap: 24px; width: 1320px; max-width: 100%; height: 100%; margin: 0 auto; padding: 0 24px; }

/* Top contact bar */
.amd-hdr__bar { height: var(--hdr-bar); overflow: hidden; background: var(--hdr-navy); color: #d9dee4; font-size: 13px; transition: height .25s ease; }
.amd-hdr__contacts, .amd-hdr__aside { display: flex; align-items: center; gap: 22px; }
.amd-hdr__aside { margin-left: auto; }
#amd-header .amd-hdr__bar a { display: inline-flex; align-items: center; gap: 7px; color: #d9dee4; }
#amd-header .amd-hdr__bar a:hover { color: #fff; }
.amd-hdr__bar i { color: var(--hdr-gold); }
#amd-header .amd-hdr__lang { padding: 3px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; font-weight: 700; letter-spacing: .04em; }
#amd-header .amd-hdr__lang:hover { border-color: var(--hdr-gold); }

/* Main bar */
.amd-hdr__main { height: var(--hdr-main); background: rgba(255,255,255,.97); box-shadow: 0 1px 0 rgba(0,0,0,.06); transition: height .25s ease, box-shadow .25s ease; }
.amd-hdr__brand { display: flex; align-items: center; gap: 12px; flex: none; }
.amd-hdr__brand img { width: 58px; height: 58px; object-fit: contain; border-radius: 4px; transition: width .25s, height .25s; }
.amd-hdr__name { display: flex; flex-direction: column; }
.amd-hdr__name strong { font-size: 17px; font-weight: 700; color: var(--hdr-ink); letter-spacing: .01em; }
.amd-hdr__name small { margin-top: 2px; font-size: 12px; color: #7a7a7a; letter-spacing: .04em; }

/* Scrolled state: hide the contact bar, compact main bar */
#amd-header.is-scrolled .amd-hdr__bar { height: 0; }
#amd-header.is-scrolled .amd-hdr__main { height: 64px; box-shadow: 0 6px 20px rgba(0,0,0,.08); }
#amd-header.is-scrolled .amd-hdr__brand img { width: 46px; height: 46px; }

/* Desktop menu */
#amd-header .amd-nav { display: block; float: none; flex: 1 1 auto; margin: 0; padding: 0; min-width: 0; }
.amd-nav__head, .amd-nav__foot { display: none; }
#amd-header .amd-menu { display: flex; justify-content: center; align-items: center; gap: 2px; }
#amd-header .amd-menu > li { position: relative; float: none; display: block; margin: 0; padding: 0; }
#amd-header .amd-menu > li > a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--hdr-ink);
    white-space: nowrap;
    background: none;
    transition: color .15s, background-color .15s;
}
#amd-header .amd-menu > li.menu-item-has-children > a::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: .55;
    transition: transform .2s;
}
#amd-header .amd-menu > li:hover > a,
#amd-header .amd-menu > li:focus-within > a { color: var(--hdr-gold); background: #fbf6ea; text-decoration: none; }
#amd-header .amd-menu > li.current-menu-item > a,
#amd-header .amd-menu > li.current-menu-ancestor > a,
#amd-header .amd-menu > li.current-menu-parent > a { color: var(--hdr-gold); text-decoration: none; }
#amd-header .amd-menu > li.current-menu-item > a::before,
#amd-header .amd-menu > li.current-menu-ancestor > a::before,
#amd-header .amd-menu > li.current-menu-parent > a::before { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--hdr-gold); }

/* Dropdown cards */
#amd-header .amd-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    display: block;
    min-width: 250px;
    margin: 0;
    padding: 8px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(20,20,20,.14), 0 0 0 1px rgba(0,0,0,.04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
#amd-header .amd-menu > li:hover > .sub-menu,
#amd-header .amd-menu > li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
#amd-header .amd-menu > li:hover > a::after { transform: rotate(225deg); margin-top: 3px; }
#amd-header .amd-menu .sub-menu li { float: none; display: block; width: auto; margin: 0; border: 0; }
#amd-header .amd-menu .sub-menu a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background: none;
    white-space: nowrap;
}
#amd-header .amd-menu .sub-menu a:hover,
#amd-header .amd-menu .sub-menu .current-menu-item > a { color: var(--hdr-gold-dark); background: #fbf6ea; text-decoration: none; }
#amd-header .amd-sub-toggle { display: none; }

/* CTA */
#amd-header .amd-hdr__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: none;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    background: var(--hdr-gold);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(193,138,11,.28);
    transition: background-color .2s, transform .2s;
}
#amd-header .amd-hdr__cta:hover { background: var(--hdr-gold-dark); color: #fff; transform: translateY(-1px); }

/* Burger */
.amd-burger { display: none; flex: none; width: 46px; height: 46px; margin-left: 4px; padding: 12px 11px; border: 0; border-radius: 10px; background: #f4efe2; cursor: pointer; }
.amd-burger span { display: block; height: 2px; margin: 4px 0; border-radius: 2px; background: var(--hdr-ink); }
.amd-nav__backdrop { position: fixed; inset: 0; z-index: 1; background: rgba(10,15,20,.45); }

/* Page offsets for the new (shorter) header */
section#slider { margin-top: calc(var(--hdr-bar) + var(--hdr-main)) !important; }

/* ---------- Tablet & mobile ---------- */
@media (max-width: 1180px) {
    #amd-header .amd-menu > li > a { padding: 10px 8px; font-size: 14px; }
    .amd-hdr__name small { display: none; }
}

@media (max-width: 1080px) {
    :root { --hdr-main: 68px; }
    .amd-hdr__bar { display: none; }
    :root { --hdr-bar: 0px; }
    .amd-hdr__in { gap: 12px; padding: 0 16px; }
    .amd-hdr__brand img { width: 48px; height: 48px; }
    .amd-hdr__name strong { font-size: 16px; }
    .amd-burger { display: block; }
    #amd-header .amd-hdr__cta--main { margin-left: auto; }

    #amd-header .amd-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 2;
        display: flex;
        flex-direction: column;
        width: min(380px, 88vw);
        background: #fff;
        box-shadow: -10px 0 30px rgba(0,0,0,.18);
        transform: translateX(105%);
        transition: transform .28s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    #amd-header.is-open .amd-nav { transform: none; }
    .amd-nav__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid #eee; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #888; }
    .amd-nav__close { width: 40px; height: 40px; border: 0; border-radius: 10px; background: #f4efe2; font-size: 18px; color: var(--hdr-ink); cursor: pointer; }

    #amd-header .amd-menu { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 10px; }
    #amd-header .amd-menu > li { display: flex; flex-wrap: wrap; align-items: center; border-bottom: 1px solid #f1f1f1; }
    #amd-header .amd-menu > li > a { flex: 1; padding: 14px 10px; font-size: 16px; white-space: normal; }
    #amd-header .amd-menu > li.menu-item-has-children > a::after { display: none; }
    #amd-header .amd-menu > li > a::before { display: none; }
    #amd-header .amd-menu > li:hover > a { background: none; }
    #amd-header .amd-sub-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: 10px;
        background: none;
        color: var(--hdr-ink);
        cursor: pointer;
    }
    #amd-header .amd-sub-toggle::before { content: ""; width: 8px; height: 8px; margin-top: -4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; }
    #amd-header li.is-open > .amd-sub-toggle::before { transform: rotate(225deg); margin-top: 4px; }
    #amd-header .amd-menu .sub-menu {
        position: static;
        flex-basis: 100%;
        display: none;
        min-width: 0;
        margin: 0 0 10px;
        padding: 4px 0 4px 10px;
        border-left: 2px solid #f0e3c2;
        border-radius: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    #amd-header li.is-open > .sub-menu { display: block; }
    #amd-header .amd-menu > li:hover > .sub-menu { display: none; }
    #amd-header .amd-menu > li.is-open:hover > .sub-menu { display: block; }
    #amd-header .amd-menu .sub-menu a { padding: 10px; white-space: normal; font-size: 15px; }

    .amd-nav__foot { display: flex; flex-direction: column; gap: 4px; margin-top: auto; padding: 18px; background: #faf7ef; }
    #amd-header .amd-nav__foot a { display: flex; align-items: center; gap: 10px; padding: 9px 4px; font-size: 15px; color: #333; }
    #amd-header .amd-nav__foot a i { width: 18px; color: var(--hdr-gold); text-align: center; }
    #amd-header .amd-nav__foot .amd-hdr__cta { justify-content: center; margin-bottom: 10px; color: #fff; }
    #amd-header .amd-nav__foot .amd-hdr__cta i { color: #fff; }

    #amd-header.is-scrolled .amd-hdr__main { height: 60px; }
    section#slider { margin-top: var(--hdr-main) !important; }
}

@media (max-width: 560px) {
    #amd-header .amd-hdr__cta--main { padding: 0 14px; min-height: 40px; font-size: 13px; }
    #amd-header .amd-hdr__cta--main i { display: none; }
    .amd-hdr__name { display: none; }
}

@media (max-width: 380px) {
    #amd-header .amd-hdr__cta--main { display: none; }
}

body.amd-nav-lock { overflow: hidden; }

/* Long URLs in page content used to widen the page on phones (and push the header off-screen). */
html { overflow-x: hidden; }
@supports (overflow: clip) { html { overflow-x: clip; } }
#pagecontent article, #pagecontent aside, .textwidget { overflow-wrap: anywhere; }
