/* ── Hebra Cemetery — global nav styles (loads on all pages) ─────────────── */

/* Desktop: Editor menu item — only override colour/padding, never display */
li.hebra-editor-menu-item {
    border-top: none !important;
}

li.hebra-editor-menu-item > a {
    padding: 15px 20px !important;
    color: #c9a84c !important;
    font-size: inherit !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    background: transparent !important;
    line-height: inherit !important;
}

li.hebra-editor-menu-item > a:hover {
    color: #a07828 !important;
    background: transparent !important;
}

/* Active state — cream highlight matching Astra */
li.hebra-editor-menu-item.current-menu-item > a {
    color: #a07828 !important;
    font-weight: 600 !important;
    background: #fef8e6 !important;
    border-radius: 4px;
}

/* Mobile: divider, block display, cog icon */
@media (max-width: 921px) {
    li.hebra-editor-menu-item {
        border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
    }
    li.hebra-editor-menu-item > a {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 12px 20px !important;
        color: #3a3a3a !important;
    }
    li.hebra-editor-menu-item > a::before {
        content: '';
        display: inline-block;
        width: 16px;
        height: 16px;
        flex-shrink: 0;
        background-color: #3a3a3a;
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E");
        -webkit-mask-size: contain;
        mask-size: contain;
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-position: center;
        mask-position: center;
    }
    li.hebra-editor-menu-item.current-menu-item > a {
        background: #fef8e6 !important;
        color: #a07828 !important;
        border-radius: 0;
    }
    li.hebra-editor-menu-item.current-menu-item > a::before {
        background-color: #a07828;
    }
}

/* ── Header search — grave results block ─────────────────────────────────── */
.hebra-header-search-results {
    max-width: 100%;
    margin: 0 0 40px 0;
    background: #faf7f2;
    border: 1px solid #ede8df;
    border-radius: 12px;
    overflow: hidden;
}

.hebra-hsr-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    background: #f5f0e8;
    border-bottom: 1px solid #ede8df;
}

.hebra-hsr-icon svg { display: block; }

.hebra-hsr-title {
    font-size: 16px;
    font-weight: 700;
    color: #c9a84c;
    margin: 0;
    padding: 0;
}

.hebra-hsr-count {
    font-size: 13px;
    color: #8a8278;
    margin-left: auto;
}

.hebra-hsr-none {
    padding: 24px;
    color: #8a8278;
    font-size: 14px;
    margin: 0;
}

.hebra-hsr-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.hebra-hsr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.hebra-hsr-table thead th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #8a8278;
    background: #f5f0e8;
    border-bottom: 1px solid #ede8df;
    white-space: nowrap;
}

.hebra-hsr-table tbody tr {
    border-bottom: 1px solid #ede8df;
    transition: background 0.1s;
}

.hebra-hsr-table tbody tr:last-child { border-bottom: none; }
.hebra-hsr-table tbody tr:hover      { background: #fdf8ee; }

.hebra-hsr-table td {
    padding: 10px 16px;
    color: #4a4540;
    vertical-align: middle;
}

.hebra-hsr-name a {
    font-weight: 600;
    color: #c9a84c;
    text-decoration: none;
}
.hebra-hsr-name a:hover { color: #a07828; }

.hebra-hsr-site  { font-size: 12px; color: #7a7268; }
.hebra-hsr-grid  { font-weight: 700; color: #c9a84c; text-align: center; }
.hebra-hsr-view  { text-align: right; }

.hebra-hsr-btn {
    display: inline-block;
    padding: 5px 12px;
    background: #c9a84c;
    color: #fff !important;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.15s;
}
.hebra-hsr-btn:hover { background: #a07828; }

@media (max-width: 600px) {
    .hebra-hsr-table thead th:nth-child(3),
    .hebra-hsr-table tbody td:nth-child(3) { display: none; }
    .hebra-hsr-header  { flex-wrap: wrap; }
    .hebra-hsr-count   { margin-left: 0; width: 100%; }
}

/* ── Search results page — centre the grave records table ────────────────── */
.search-results .hebra-header-search-results {
    max-width: 760px;
    margin: 0 auto 40px auto;
}

/* ── Login — hamburger menu item ─────────────────────────────────────────── */
li.hebra-login-menu-item {
    border-top: 1px solid rgba(201,168,76,.35) !important;
    margin-top: 4px !important;
}
li.hebra-login-menu-item > a {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 12px 20px !important;
    color: #c9a84c !important;
    font-weight: 500 !important;
    background: transparent !important;
    text-decoration: none !important;
}
li.hebra-login-menu-item > a:hover {
    color: #a07828 !important;
    background: transparent !important;
}
/* Hide login item on desktop nav — only show in mobile hamburger */
@media (min-width: 922px) {
    li.hebra-login-menu-item { display: none !important; }
}

/* ── Login — desktop FAB (bottom-left) ───────────────────────────────────── */
#hebra-login-fab {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9990;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #c9a84c;
    color: #c9a84c;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
    transition: background .15s, color .15s, box-shadow .15s;
    padding: 0;
}
#hebra-login-fab:hover {
    background: #c9a84c;
    color: #fff;
    box-shadow: 0 4px 18px rgba(201,168,76,.4);
}
/* Hide FAB on mobile — hamburger item covers it */
@media (max-width: 921px) {
    #hebra-login-fab { display: none !important; }
}

/* ── Login — popup overlay ───────────────────────────────────────────────── */
#hebra-login-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99998;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
#hebra-login-overlay.hebra-login-open {
    display: flex;
}

/* ── Login — modal card ──────────────────────────────────────────────────── */
#hebra-login-modal {
    position: relative;
    background: #fff;
    border: 2px solid #c9a84c;
    border-radius: 16px;
    padding: 40px 36px 32px;
    width: min(400px, 92vw);
    box-shadow: 0 8px 48px rgba(0,0,0,.25), 0 0 0 4px rgba(201,168,76,.12);
    text-align: center;
}
#hebra-login-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color .15s;
}
#hebra-login-close:hover { color: #c9a84c; }

#hebra-login-logo { margin-bottom: 12px; }

#hebra-login-title {
    font-size: 18px;
    font-weight: 700;
    color: #2a2520;
    margin: 0 0 4px;
}
#hebra-login-sub {
    font-size: 13px;
    color: #9a9188;
    margin: 0 0 24px;
}

.hebra-lf-field {
    text-align: left;
    margin-bottom: 16px;
}
.hebra-lf-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6a6258;
    margin-bottom: 5px;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.hebra-lf-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1.5px solid #ddd8d0;
    border-radius: 8px;
    font-size: 15px;
    color: #2a2520;
    background: #faf7f2;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.hebra-lf-field input:focus {
    border-color: #c9a84c;
    box-shadow: 0 0 0 3px rgba(201,168,76,.18);
    background: #fff;
}

#hebra-lf-submit {
    width: 100%;
    padding: 11px;
    background: #c9a84c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    letter-spacing: .02em;
    transition: background .15s;
}
#hebra-lf-submit:hover { background: #a07828; }

#hebra-lf-forgot {
    display: block;
    margin-top: 14px;
    font-size: 12px;
    color: #b09050;
    text-decoration: none;
}
#hebra-lf-forgot:hover { color: #a07828; text-decoration: underline; }

/* ── Search page — hide WP "no results" message (we handle results ourselves) */
.search-no-results .page-content,
.search-results .no-results,
.search .no-results {
    display: none !important;
}

/* ── Hamburger dropdown — rounded corners + open animation ───────────────── */

/* Astra wraps the mobile nav in .ast-mobile-popup-drawer or
   .main-header-bar-navigation depending on the header builder setting.
   We target both, plus the toggled class Astra adds on open. */

@media (max-width: 921px) {

    /* The nav container itself */
    .main-header-bar-navigation,
    .ast-mobile-popup-drawer .ast-mobile-popup-inner,
    #ast-mobile-popup-wrapper .ast-mobile-popup-inner {
        border-radius: 0 0 16px 16px !important;
        overflow: hidden !important;
        /* start state — collapsed */
        transform-origin: top center;
    }

    /* Slide-down keyframe */
    @keyframes hebraMenuSlideDown {
        from {
            opacity: 0;
            transform: translateY(-10px) scaleY(0.95);
        }
        to {
            opacity: 1;
            transform: translateY(0) scaleY(1);
        }
    }

    /* Astra toggles .toggle-on or .ast-mobile-menu-active on open */
    .main-header-bar-navigation.toggle-on,
    .main-header-bar-navigation.ast-mobile-menu-active,
    .ast-mobile-popup-drawer.active .ast-mobile-popup-inner,
    .ast-mobile-popup-drawer.toggle-on .ast-mobile-popup-inner {
        animation: hebraMenuSlideDown 0.22s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    }

    /* Also apply to the ul directly in case Astra animates the list */
    .main-header-bar-navigation > .ast-nav-menu,
    .main-header-bar-navigation > ul {
        border-radius: 0 0 16px 16px !important;
        overflow: hidden !important;
    }
}
