/* ==========================================================================
   חברה קדישא — תפריט עליון מותאם (Topbar)
   כל המחלקות מתחילות ב-.ka-topbar למניעת התנגשות עם Astra / WP / Elementor
   ========================================================================== */

.ka-topbar,
.ka-topbar * {
    box-sizing: border-box;
}

.ka-topbar {
    --kt-burgundy: #6B2D2D;
    --kt-burgundy-dark: #4A1E1E;
    --kt-burgundy-darker: #321414;
    --kt-gold: #B08B4F;
    --kt-gold-light: #D4B878;
    --kt-gold-pale: #E8D9B8;
    --kt-cream: #F7F2E9;
    --kt-height: 76px;
    --kt-height-mobile: 64px;

    position: fixed;
    inset-inline: 0;
    top: 0;
    z-index: 99990;
    height: var(--kt-height);
    background: linear-gradient(135deg, var(--kt-burgundy-darker) 0%, var(--kt-burgundy-dark) 55%, var(--kt-burgundy) 100%);
    border-bottom: 1px solid rgba(212, 184, 120, 0.18);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
    direction: rtl;
    font-family: 'Assistant', 'Frank Ruhl Libre', Arial, sans-serif;
}

body.admin-bar .ka-topbar { top: 32px; }
@media (max-width: 782px) { body.admin-bar .ka-topbar { top: 46px; } }

/* שכבת ברק עדינה */
.ka-topbar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 15% 30%, rgba(212, 184, 120, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

.ka-topbar-inner {
    position: relative;
    z-index: 2;
    height: 100%;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* ---------- לוגו / מותג ---------- */

.ka-topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--kt-cream);
    text-decoration: none;
    flex-shrink: 0;
    min-width: 0;
    transition: opacity 0.25s;
}
.ka-topbar-brand:hover { opacity: 0.92; color: var(--kt-cream); }

.ka-topbar-logo {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 1.5px solid var(--kt-gold-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Frank Ruhl Libre', serif;
    font-weight: 500;
    font-size: 1.375rem;
    color: var(--kt-gold-light);
    background: radial-gradient(circle at 30% 30%, rgba(212, 184, 120, 0.12), transparent 70%), rgba(0, 0, 0, 0.25);
    line-height: 1;
    padding-bottom: 2px;
    overflow: hidden;
}
.ka-topbar-logo--image {
    padding: 0;
    background: transparent;
}
.ka-topbar-logo--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ka-topbar-logo--unframed {
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
    padding: 0;
}
.ka-topbar-logo--unframed.ka-topbar-logo--image img {
    object-fit: contain;
}

.ka-topbar-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.ka-topbar-title {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--kt-cream);
    letter-spacing: 0.02em;
    line-height: 1.2;
    white-space: nowrap;
}
.ka-topbar-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--kt-gold-pale);
    letter-spacing: 0.05em;
    margin-top: 2px;
    white-space: nowrap;
    opacity: 0.85;
}

/* ---------- תפריט ראשי (דסקטופ) ---------- */

.ka-topbar-nav {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.ka-topbar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.125rem;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}
.ka-topbar-menu::-webkit-scrollbar { display: none; }

.ka-topbar-menu > li {
    list-style: none;
    position: relative;
}

.ka-topbar .ka-topbar-menu > li > a,
.ka-topbar .ka-topbar-menu > li > span {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.95rem;
    color: var(--kt-cream) !important;
    text-decoration: none !important;
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: 4px;
    transition: color 0.25s, background 0.25s;
    white-space: nowrap;
    line-height: 1.4;
    border: 0;
    position: relative;
}

.ka-topbar .ka-topbar-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    inset-inline: 0.95rem;
    height: 1.5px;
    background: var(--kt-gold-light);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
    border-radius: 1px;
}
.ka-topbar .ka-topbar-menu > li > a:hover::after,
.ka-topbar .ka-topbar-menu > li > a:focus-visible::after,
.ka-topbar .ka-topbar-menu > li.current-menu-item > a::after,
.ka-topbar .ka-topbar-menu > li.current_page_item > a::after,
.ka-topbar .ka-topbar-menu > li.current-menu-parent > a::after,
.ka-topbar .ka-topbar-menu > li.current-menu-ancestor > a::after {
    transform: scaleX(1);
}

.ka-topbar .ka-topbar-menu > li > a:hover,
.ka-topbar .ka-topbar-menu > li > a:focus-visible {
    color: var(--kt-gold-light) !important;
    background: rgba(255, 255, 255, 0.04);
    outline: none;
}
.ka-topbar .ka-topbar-menu > li.current-menu-item > a,
.ka-topbar .ka-topbar-menu > li.current_page_item > a,
.ka-topbar .ka-topbar-menu > li.current-menu-parent > a,
.ka-topbar .ka-topbar-menu > li.current-menu-ancestor > a {
    color: var(--kt-gold-light) !important;
}

/* תפריט משנה (dropdown) */
.ka-topbar-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0.375rem 0;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 220px;
    background: linear-gradient(135deg, var(--kt-burgundy-dark), var(--kt-burgundy));
    border: 1px solid rgba(212, 184, 120, 0.25);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s ease;
    z-index: 99991;
}
.ka-topbar-menu > li:hover > .sub-menu,
.ka-topbar-menu > li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.ka-topbar .ka-topbar-menu .sub-menu a {
    display: block;
    padding: 0.55rem 1rem;
    color: var(--kt-cream) !important;
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 0.95rem;
    text-decoration: none !important;
    border-radius: 3px;
    margin: 0 0.375rem;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.ka-topbar .ka-topbar-menu .sub-menu a:hover,
.ka-topbar .ka-topbar-menu .sub-menu a:focus-visible {
    background: rgba(212, 184, 120, 0.12);
    color: var(--kt-gold-light) !important;
}

/* ---------- כפתור טלפון ---------- */

.ka-topbar-phone {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--kt-gold-light);
    border-radius: 6px;
    background: rgba(212, 184, 120, 0.08);
    color: var(--kt-gold-light) !important;
    text-decoration: none !important;
    font-family: 'Assistant', sans-serif;
    transition: background 0.25s, color 0.25s, transform 0.25s;
    line-height: 1.2;
}
.ka-topbar-phone:hover,
.ka-topbar-phone:focus-visible {
    background: var(--kt-gold-light);
    color: var(--kt-burgundy-darker) !important;
    outline: none;
    transform: translateY(-1px);
}
.ka-topbar-phone-icon { display: inline-flex; align-items: center; }
.ka-topbar-phone-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.ka-topbar-phone-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.9;
}
.ka-topbar-phone-number {
    font-size: 0.95rem;
    font-weight: 700;
    direction: ltr;
    letter-spacing: 0.02em;
}

/* ---------- כפתור המבורגר ---------- */

.ka-topbar-burger {
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: 1px solid rgba(212, 184, 120, 0.35);
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
    z-index: 3;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.ka-topbar-burger:hover,
.ka-topbar-burger:focus-visible {
    border-color: var(--kt-gold-light);
    background: rgba(212, 184, 120, 0.08);
    outline: none;
}
.ka-topbar-burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--kt-cream);
    border-radius: 1px;
    transition: all 0.3s ease;
    transform-origin: center;
}
.ka-topbar.is-open .ka-topbar-burger span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
    background: var(--kt-gold-light);
}
.ka-topbar.is-open .ka-topbar-burger span:nth-child(2) {
    opacity: 0;
}
.ka-topbar.is-open .ka-topbar-burger span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
    background: var(--kt-gold-light);
}

/* ---------- Drawer (מובייל) ---------- */

.ka-topbar-drawer {
    position: fixed;
    top: var(--kt-height);
    right: 0;
    width: min(340px, 88vw);
    max-width: 100%;
    height: calc(100vh - var(--kt-height));
    background: linear-gradient(160deg, var(--kt-burgundy-darker) 0%, var(--kt-burgundy-dark) 60%, var(--kt-burgundy) 100%);
    padding: 1.5rem 1rem 2rem;
    transform: translateX(110%);
    transition: transform 0.3s ease;
    box-shadow: -8px 0 28px rgba(0, 0, 0, 0.35);
    overflow-y: auto;
    overscroll-behavior: contain;
    display: none;
    z-index: 99989;
}
body.admin-bar .ka-topbar-drawer { top: calc(var(--kt-height) + 32px); height: calc(100vh - var(--kt-height) - 32px); }
@media (max-width: 782px) { body.admin-bar .ka-topbar-drawer { top: calc(var(--kt-height-mobile) + 46px); height: calc(100vh - var(--kt-height-mobile) - 46px); } }

.ka-topbar.is-open .ka-topbar-drawer {
    transform: translateX(0);
}

.ka-topbar-drawer-menu {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.ka-topbar-drawer-menu > li { list-style: none; }
.ka-topbar .ka-topbar-drawer-menu a {
    display: block;
    padding: 0.95rem 1rem;
    color: var(--kt-cream) !important;
    text-decoration: none !important;
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: 4px;
    border-bottom: 1px solid rgba(212, 184, 120, 0.1);
    transition: background 0.2s, color 0.2s;
}
.ka-topbar .ka-topbar-drawer-menu a:hover,
.ka-topbar .ka-topbar-drawer-menu a:focus-visible,
.ka-topbar .ka-topbar-drawer-menu .current-menu-item > a,
.ka-topbar .ka-topbar-drawer-menu .current_page_item > a {
    background: rgba(212, 184, 120, 0.1);
    color: var(--kt-gold-light) !important;
}
.ka-topbar-drawer-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0.75rem 0.5rem;
}
.ka-topbar-drawer-menu .sub-menu a { font-size: 1.05rem; padding: 0.7rem 1rem; }

.ka-topbar-drawer-phone {
    display: block;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--kt-gold-light);
    border-radius: 5px;
    text-align: center;
    color: var(--kt-gold-light) !important;
    text-decoration: none !important;
    font-weight: 700;
    font-family: 'Assistant', sans-serif;
    direction: ltr;
    transition: background 0.25s, color 0.25s;
}
.ka-topbar-drawer-phone:hover {
    background: var(--kt-gold-light);
    color: var(--kt-burgundy-darker) !important;
}

.ka-topbar-backdrop {
    position: fixed;
    inset: 0;
    top: var(--kt-height);
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    z-index: 99988;
    display: none;
}
body.admin-bar .ka-topbar-backdrop { top: calc(var(--kt-height) + 32px); }
@media (max-width: 782px) { body.admin-bar .ka-topbar-backdrop { top: calc(var(--kt-height-mobile) + 46px); } }
.ka-topbar.is-open .ka-topbar-backdrop { opacity: 1; visibility: visible; }

/* ---------- רספונסיבי ---------- */

@media (max-width: 1100px) {
    /* תת-כותרת נשארת מוצגת - רק מצטמצמת. (היה display:none כאן.) */
    .ka-topbar-subtitle { font-size: 0.7rem; }
    .ka-topbar .ka-topbar-menu > li > a { padding: 0.55rem 0.7rem; font-size: 1.12rem; }
}

@media (max-width: 960px) {
    .ka-topbar { height: var(--kt-height-mobile); }
    .ka-topbar-nav { display: none; }
    .ka-topbar-burger { display: flex; margin-inline-start: auto; }
    /* כשיש גם טלפון – דוחפים את הטלפון לקצה, וההמבורגר נצמד אליו בגפ רגיל */
    .ka-topbar--has-phone .ka-topbar-phone { margin-inline-start: auto; }
    .ka-topbar--has-phone .ka-topbar-burger { margin-inline-start: 0; }
    .ka-topbar-drawer { display: block; top: var(--kt-height-mobile); height: calc(100vh - var(--kt-height-mobile)); }
    .ka-topbar-backdrop { display: block; top: var(--kt-height-mobile); }
    .ka-topbar-logo { width: 40px; height: 40px; font-size: 1.25rem; }
    .ka-topbar-title { font-size: 1rem; }
    .ka-topbar-phone { padding: 0.4rem 0.6rem; }
    .ka-topbar-phone-label { font-size: 0.625rem; }
    .ka-topbar-phone-number { font-size: 0.875rem; }
}

@media (max-width: 640px) {
    .ka-topbar-inner { padding: 0 0.875rem; gap: 0.5rem; }
    .ka-topbar-phone-text { display: none; }
    .ka-topbar-phone { padding: 0.55rem; border-radius: 50%; width: 40px; height: 40px; justify-content: center; }
    .ka-topbar-title { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
    .ka-topbar-subtitle {
        font-size: 0.62rem;
        line-height: 1.2;
        white-space: normal;     /* מאפשר שבירה לשורה שניה במקום ellipsis */
        max-width: 160px;
    }
}

@media (max-width: 420px) {
    .ka-topbar-title { font-size: 0.9375rem; max-width: 130px; }
    .ka-topbar-subtitle { font-size: 0.58rem; max-width: 130px; }
    .ka-topbar-logo { width: 36px; height: 36px; font-size: 1.125rem; }
}

/* מונע מהדף להיגלל כשה-drawer פתוח */
body.ka-topbar-locked { overflow: hidden; }

/* ==========================================================================
 * Breadcrumbs - מופיע ב-singular CPTs + archives + עמודי landing.
 * נטען כאן ב-topbar.css כי הוא הקובץ היחיד שמוטמע בכל עמוד באתר.
 * ========================================================================== */

.kadisha-breadcrumbs {
    background: #faf6ee;
    border-bottom: 1px solid #d7cbb5;
    padding: 0.55rem 0;
    font-family: 'Frank Ruhl Libre', 'Assistant', serif;
    font-size: 0.92rem;
    direction: rtl;
    color: #6f6960;
}
.kadisha-breadcrumbs-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.kadisha-breadcrumbs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    line-height: 1.4;
}
.kadisha-breadcrumbs-item {
    display: inline-flex;
    align-items: center;
    margin: 0;
}
.kadisha-breadcrumbs-item a,
.kadisha-breadcrumbs-item a:visited {
    color: #6B2D2D;
    text-decoration: none;
    transition: color 0.15s;
}
.kadisha-breadcrumbs-item a:hover,
.kadisha-breadcrumbs-item a:focus-visible {
    color: #B08B4F;
    text-decoration: underline;
}
.kadisha-breadcrumbs-item.is-current span {
    color: #4A1E1E;
    font-weight: 600;
}
.kadisha-breadcrumbs-sep {
    margin: 0 0.45rem;
    color: #c9b88e;
    user-select: none;
}
@media (max-width: 600px) {
    .kadisha-breadcrumbs { padding: 0.45rem 0; font-size: 0.85rem; }
    .kadisha-breadcrumbs-inner { padding: 0 1rem; }
    .kadisha-breadcrumbs-sep { margin: 0 0.3rem; }
}
