/* =========================================================
   HEADER – FINAL / COMPACT MENU PANEL / 60+ FRIENDLY
========================================================= */

:root{
  --header-paper-1:#f7f3ec;
  --header-paper-2:#f2ede4;
  --header-paper-3:#fcfaf5;
  --header-paper-4:#f6f0e6;

  --header-dark-1:#1b1d20;
  --header-dark-2:#17191c;
  --header-dark-3:#202328;
  --header-dark-4:#1a1d21;

  --header-gold-rgb:181,135,53;

  --header-kicker:#7b694d;
  --header-text-strong:#241f19;

  --header-max:980px;
  --header-bar-h:58px;
  --header-radius-md:12px;
  --header-shadow-panel:0 18px 42px rgba(0,0,0,.16);
}

/* =========================================================
   BASE
========================================================= */

.site-header{
  position:sticky;
  top:0;
  z-index:1030;
  margin-bottom:0;
  padding-top:0;
  background:transparent;
}

.site-header .site-frame{
  position:relative;
}

.header-shell{
  position:relative;
  padding:10px 18px 8px;
  background:linear-gradient(180deg,var(--header-paper-1) 0%,var(--header-paper-2) 100%);
  border-radius:0;
  box-shadow:
    0 6px 18px rgba(84,61,24,.04),
    inset 0 1px 0 rgba(255,255,255,.56);
}

.header-shell::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 16% 0%, rgba(182,137,63,.04), transparent 24%),
    radial-gradient(circle at 84% 0%, rgba(182,137,63,.03), transparent 22%);
}

body.dark .header-shell{
  background:linear-gradient(180deg,var(--header-dark-1) 0%,var(--header-dark-2) 100%);
  box-shadow:
    0 10px 24px rgba(0,0,0,.22),
    inset 0 1px 0 rgba(255,255,255,.04);
}

body.dark .header-shell::before{
  background:
    radial-gradient(circle at 16% 0%, rgba(182,137,63,.06), transparent 24%),
    radial-gradient(circle at 84% 0%, rgba(182,137,63,.05), transparent 22%);
}

/* =========================================================
   TRANSITIONS / FOCUS
========================================================= */

.header-menu-toggle,
.header-menu-close,
.header-login-link,
.header-menu-link,
.header-menu-section-toggle,
.header-menu-category-link,
.header-menu-tool,
.header-menu-lang,
.header-menu-search-input,
.header-menu-search-submit,
.header-date-minimal{
  transition:var(--ui-transition);
}

.header-menu-toggle:focus-visible,
.header-menu-close:focus-visible,
.header-login-link:focus-visible,
.header-menu-link:focus-visible,
.header-menu-section-toggle:focus-visible,
.header-menu-category-link:focus-visible,
.header-menu-tool:focus-visible,
.header-menu-lang:focus-visible,
.header-menu-search-input:focus-visible,
.header-menu-search-submit:focus-visible,
.header-date-minimal:focus-visible{
  outline:0;
  box-shadow:var(--ui-focus-ring);
}

body.dark .header-menu-toggle:focus-visible,
body.dark .header-menu-close:focus-visible,
body.dark .header-login-link:focus-visible,
body.dark .header-menu-link:focus-visible,
body.dark .header-menu-section-toggle:focus-visible,
body.dark .header-menu-category-link:focus-visible,
body.dark .header-menu-tool:focus-visible,
body.dark .header-menu-lang:focus-visible,
body.dark .header-menu-search-input:focus-visible,
body.dark .header-menu-search-submit:focus-visible,
body.dark .header-date-minimal:focus-visible{
  box-shadow:var(--ui-focus-ring-dark);
}

/* =========================================================
   SHARED SURFACES
========================================================= */

.header-menu-toggle,
.header-login-link,
.header-menu-lang,
.header-menu-tool{
  border:1px solid rgba(181,135,53,.14);
  background:linear-gradient(180deg,#f3ede2 0%, #ece4d6 100%);
  box-shadow:
    0 3px 8px rgba(84,61,24,.035),
    inset 0 1px 0 rgba(255,255,255,.35);
}

body.dark .header-menu-toggle,
body.dark .header-login-link,
body.dark .header-menu-lang,
body.dark .header-menu-tool{
  background:rgba(255,255,255,.06);
  border-color:rgba(181,135,53,.16);
  box-shadow:none;
}

.header-menu-toggle:hover,
.header-login-link:hover,
.header-menu-lang:hover,
.header-menu-tool:hover{
  background:linear-gradient(180deg,#f7f1e7 0%, #efe7da 100%);
  border-color:rgba(181,135,53,.22);
  transform:translateY(-1px);
}

body.dark .header-menu-toggle:hover,
body.dark .header-login-link:hover,
body.dark .header-menu-lang:hover,
body.dark .header-menu-tool:hover{
  background:rgba(255,255,255,.10);
}

/* =========================================================
   BAR
========================================================= */

.header-bar{
  width:min(var(--header-max), 100%);
  min-height:var(--header-bar-h);
  margin:0 auto;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
}

.header-bar-left,
.header-bar-right{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}

.header-bar-left{ justify-content:flex-start; }
.header-bar-right{ justify-content:flex-end; }

.header-bar-center{
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* =========================================================
   MENU TOGGLE / LOGIN
========================================================= */

.header-menu-toggle,
.header-login-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:38px;
  padding:0 14px;
  border-radius:12px;
  font-size:.92rem;
  font-weight:760;
  text-decoration:none;
}

.header-menu-toggle{
  justify-content:center;
  gap:9px;
  color:var(--header-text-strong);
  cursor:pointer;
}

.header-menu-toggle i{
  font-size:.98rem;
  line-height:1;
}

.header-login-link{
  color:var(--text);
}

.header-login-link i{
  font-size:.88rem;
}

body.dark .header-menu-toggle,
body.dark .header-login-link{
  color:#f3f4f6;
}

/* =========================================================
   BRAND
========================================================= */

.header-brand-minimal{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  min-width:0;
  color:var(--text);
  text-decoration:none;
}

.header-brand-minimal:hover,
.header-date-minimal:hover,
.header-menu-category-link:hover,
.header-menu-link:hover{
  opacity:1;
}

.header-brand-eyebrow{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  color:var(--header-kicker);
  font-size:.72rem;
  font-weight:800;
  line-height:1;
  letter-spacing:.16em;
  text-transform:uppercase;
  white-space:nowrap;
}

.header-brand-eyebrow::before,
.header-brand-eyebrow::after{
  content:"";
  width:16px;
  height:1px;
  background:linear-gradient(90deg, transparent, rgba(var(--header-gold-rgb),.25), transparent);
}

.header-brand-title{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:.26em;
  font-size:clamp(1.35rem,2.6vw,2.15rem);
  font-weight:900;
  line-height:1;
  text-align:center;
  text-wrap:balance;
}

html[lang="de-DE"] .header-brand-title{
  font-family:var(--font-sans-de);
  letter-spacing:-.02em;
}

html[lang="fa-AF"] .header-brand-title{
  font-family:var(--font-sans-prs);
  line-height:1.04;
}

.brand-green{ color:var(--brand-green); }
.brand-red{ color:var(--brand-red); }
.brand-black{ color:var(--brand-black); }

body.dark .header-brand-eyebrow{
  color:#bfa989;
}

body.dark .header-brand-eyebrow::before,
body.dark .header-brand-eyebrow::after{
  background:linear-gradient(90deg, transparent, rgba(var(--header-gold-rgb),.18), transparent);
}

body.dark .brand-green{ color:#61cf7b; }
body.dark .brand-red{ color:#f17881; }
body.dark .brand-black{ color:#f3f4f6; }

/* =========================================================
   DATE ROW
========================================================= */

.header-date-row{
  width:min(var(--header-max), 100%);
  margin:2px auto 0;
  display:flex;
  align-items:center;
  justify-content:center;
}

.header-date-minimal{
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1px;
  max-width:360px;
  color:var(--text);
  text-decoration:none;
}

.header-date-kicker{
  color:var(--header-kicker);
  font-size:8px;
  font-weight:800;
  line-height:1;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.header-date-main{
  color:var(--text);
  font-size:11px;
  font-weight:800;
  line-height:1.15;
  letter-spacing:0;
}

body.dark .header-date-kicker{ color:#bba88a; }

/* =========================================================
   BACKDROP / PANEL
========================================================= */

.header-menu-backdrop{
  position:fixed;
  inset:0;
  z-index:1080;
  background:rgba(0,0,0,.28);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
}

body.dark .header-menu-backdrop{
  background:rgba(0,0,0,.42);
}

.header-menu-panel{
  position:fixed;
  top:0;
  left:0;
  z-index:1090;
  width:min(420px, 94vw);
  height:100dvh;
  overflow-y:auto;
  overscroll-behavior:contain;
  background:linear-gradient(180deg,var(--header-paper-3) 0%,var(--header-paper-4) 100%);
  border-inline-end:1px solid rgba(var(--header-gold-rgb),.12);
  box-shadow:var(--header-shadow-panel);
}

body.dark .header-menu-panel{
  background:linear-gradient(180deg,var(--header-dark-3) 0%,var(--header-dark-4) 100%);
  border-inline-end-color:rgba(var(--header-gold-rgb),.16);
}

html[dir="rtl"] .header-menu-panel{
  left:auto;
  right:0;
  border-inline-end:none;
  border-inline-start:1px solid rgba(var(--header-gold-rgb),.12);
}

html[dir="rtl"] body.dark .header-menu-panel{
  border-inline-start-color:rgba(var(--header-gold-rgb),.16);
}

.header-menu-panel-inner{
  padding:18px 16px 22px;
}

/* =========================================================
   MENU TOP / CLOSE
========================================================= */

.header-menu-top{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  margin-bottom:12px;
}

.header-menu-close{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  color:var(--header-text-strong);
  background:rgba(255,255,255,.78);
  border:1px solid rgba(var(--header-gold-rgb),.12);
  border-radius:var(--ui-radius-md);
  box-shadow:var(--ui-shadow-soft);
  cursor:pointer;
}

.header-menu-close:hover{
  background:#fff;
  transform:translateY(-1px);
}

.header-menu-close i{
  font-size:1.15rem;
  line-height:1;
}

body.dark .header-menu-close{
  color:#f3f4f6;
  background:rgba(255,255,255,.07);
  border-color:rgba(var(--header-gold-rgb),.16);
  box-shadow:var(--ui-shadow-dark);
}

body.dark .header-menu-close:hover{
  background:rgba(255,255,255,.11);
}

/* =========================================================
   SEARCH
========================================================= */

.header-menu-search{
  margin-bottom:18px;
}

.header-menu-search-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
}

.header-menu-search-input{
  width:100%;
  min-width:0;
  min-height:48px;
  padding:0 14px;
  box-sizing:border-box;
  color:var(--text);
  font-size:1rem;
  background:rgba(255,255,255,.94);
  border:1px solid rgba(var(--header-gold-rgb),.16);
  border-radius:var(--header-radius-md);
}

.header-menu-search-input::placeholder{
  color:var(--muted);
  opacity:1;
}

.header-menu-search-input:focus{
  outline:none;
  background:#fff;
  border-color:rgba(31,139,36,.30);
  box-shadow:0 0 0 3px rgba(31,139,36,.10);
}

.header-menu-search-submit{
  min-height:48px;
  padding:0 16px;
  color:#111;
  font-size:.95rem;
  font-weight:800;
  background:rgba(181,135,53,.14);
  border:1px solid rgba(var(--header-gold-rgb),.16);
  border-radius:var(--header-radius-md);
  cursor:pointer;
}

.header-menu-search-submit:hover{
  background:rgba(181,135,53,.20);
  transform:translateY(-1px);
}

body.dark .header-menu-search-input{
  color:var(--text);
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.10);
}

body.dark .header-menu-search-input:focus{
  background:rgba(255,255,255,.09);
  border-color:rgba(31,139,36,.34);
  box-shadow:0 0 0 3px rgba(31,139,36,.14);
}

body.dark .header-menu-search-submit{
  color:#f3f4f6;
  background:rgba(181,135,53,.14);
  border-color:rgba(var(--header-gold-rgb),.16);
}

body.dark .header-menu-search-submit:hover{
  background:rgba(181,135,53,.20);
}

html[dir="rtl"] .header-menu-search-input,
html[dir="rtl"] .header-menu-tool{
  text-align:right;
}

html[dir="rtl"] .header-menu-tool{
  justify-content:flex-end;
}

/* =========================================================
   MENU STRUCTURE
========================================================= */

.header-menu-group{ margin-top:18px; }
.header-menu-group:first-of-type{ margin-top:0; }

.header-menu-group-title{
  display:block;
  margin:0 0 8px;
  padding:0 14px;
  color:#7b694d;
  font-size:.78rem;
  font-weight:800;
  line-height:1.2;
  letter-spacing:.04em;
  text-transform:uppercase;
}

body.dark .header-menu-group-title{ color:#bfa989; }

.header-menu-nav,
.header-menu-categories{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.header-menu-section{
  margin-top:18px;
  padding-top:16px;
  border-top:1px solid rgba(181,135,53,.12);
}

body.dark .header-menu-section{
  border-top-color:rgba(181,135,53,.14);
}

/* =========================================================
   MENU LINKS / TOGGLES
========================================================= */

.header-menu-link,
.header-menu-section-toggle,
.header-menu-category-link{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:0 14px;
  border-radius:10px;
  text-decoration:none;
}

.header-menu-link,
.header-menu-section-toggle{
  min-height:46px;
  color:var(--header-text-strong);
  font-size:1rem;
}

.header-menu-link{
  justify-content:space-between;
  font-weight:760;
  line-height:1.35;
  background:transparent;
  border:1px solid transparent;
}

.header-menu-link:hover,
.header-menu-section-toggle:hover,
.header-menu-category-link:hover{
  background:rgba(181,135,53,.06);
}

.header-menu-link.active{
  background:rgba(181,135,53,.10);
  border-color:rgba(181,135,53,.14);
}

.header-menu-link-external{ color:#6a5b44; }

.header-menu-link.management{
  color:#c1121f;
  font-weight:900;
}

.header-menu-link.management:hover{
  color:#a20f1a;
  background:rgba(193,18,31,.08);
}

.header-menu-link.management.active{
  color:#a20f1a;
  background:rgba(193,18,31,.10);
  border-color:rgba(193,18,31,.18);
}

.header-menu-section-toggle{
  justify-content:space-between;
  gap:12px;
  font-weight:780;
  background:transparent;
  border:1px solid transparent;
  cursor:pointer;
}

.header-menu-section-toggle i{
  font-size:.78rem;
  opacity:.9;
  transition:transform .16s ease;
}

.header-menu-section-toggle[aria-expanded="true"] i{
  transform:rotate(180deg);
}

.header-menu-categories{
  margin-top:8px;
  padding-inline-start:8px;
}

html[dir="rtl"] .header-menu-categories{
  padding-inline-start:0;
  padding-inline-end:8px;
}

.header-menu-category-link{
  color:#5d5144;
  font-size:.92rem;
  font-weight:700;
  line-height:1.35;
}

.header-menu-category-link:hover{
  color:var(--header-text-strong);
}

body.dark .header-menu-link,
body.dark .header-menu-section-toggle{
  color:#f3f4f6;
}

body.dark .header-menu-link:hover,
body.dark .header-menu-section-toggle:hover,
body.dark .header-menu-category-link:hover{
  background:rgba(181,135,53,.10);
}

body.dark .header-menu-link.active{
  background:rgba(181,135,53,.14);
  border-color:rgba(181,135,53,.18);
}

body.dark .header-menu-link-external{ color:#dfd3bc; }

body.dark .header-menu-link.management{ color:#ff7d86; }

body.dark .header-menu-link.management:hover{
  color:#ff9aa1;
  background:rgba(193,18,31,.14);
}

body.dark .header-menu-link.management.active{
  color:#ff9aa1;
  background:rgba(193,18,31,.18);
  border-color:rgba(193,18,31,.24);
}

body.dark .header-menu-category-link{ color:#ddd1b9; }
body.dark .header-menu-category-link:hover{ color:#fff; }

/* =========================================================
   SETTINGS
========================================================= */

.header-menu-language{
  display:flex;
  gap:8px;
  margin-top:8px;
}

.header-menu-lang{
  flex:1 1 0;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:0 12px;
  color:var(--header-text-strong);
  font-size:.9rem;
  font-weight:800;
  text-align:center;
  text-decoration:none;
  border-radius:10px;
}

.header-menu-lang.active,
.header-menu-tool.is-active{
  color:#7d571e;
  border-color:rgba(181,135,53,.26);
  background:linear-gradient(180deg,#efe4cf 0%, #e7dac2 100%);
}

body.dark .header-menu-lang,
body.dark .header-menu-tool{
  color:#f3f4f6;
}

body.dark .header-menu-lang.active,
body.dark .header-menu-tool.is-active{
  color:#edd18a;
  background:rgba(var(--header-gold-rgb),.12);
}

.header-menu-tools{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:8px;
}

.header-menu-tool{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  min-height:46px;
  padding:0 14px;
  color:var(--header-text-strong);
  font-size:.96rem;
  font-weight:780;
  text-align:start;
  border-radius:10px;
  cursor:pointer;
}

/* =========================================================
   BODY STATE
========================================================= */

body.menu-open{ overflow:hidden; }

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width:991.98px){
  .header-shell{ padding:8px 14px 7px; }

  .header-bar{
    min-height:52px;
    gap:10px;
  }

  .header-menu-toggle{
    min-height:36px;
    padding:0 12px;
    font-size:.88rem;
  }

  .header-brand-eyebrow{ font-size:.66rem; }
  .header-brand-title{ font-size:clamp(1.2rem,3vw,1.85rem); }

  .header-login-link{
    min-height:36px;
    padding:0 12px;
    font-size:.88rem;
  }
}

@media (max-width:767.98px){
  .header-shell{ padding:8px 12px 7px; }

  .header-bar{
    grid-template-columns:auto minmax(0,1fr) auto;
    min-height:48px;
    gap:8px;
  }

  .header-menu-toggle{
    min-height:36px;
    padding:0 10px;
  }

  .header-menu-toggle span,
  .header-login-link span{
    display:none;
  }

  .header-brand-eyebrow{
    font-size:.58rem;
    gap:6px;
  }

  .header-brand-eyebrow::before,
  .header-brand-eyebrow::after{
    width:12px;
  }

  .header-brand-title{
    font-size:clamp(1.05rem,4.8vw,1.55rem);
    gap:.2em;
  }

  .header-login-link{
    min-height:36px;
    padding:0 10px;
  }

  .header-date-main{ font-size:10px; }

  .header-menu-panel{ width:min(420px, 100vw); }
  .header-menu-panel-inner{ padding:16px 12px 20px; }

  .header-menu-search-form{ grid-template-columns:minmax(0,1fr); }
  .header-menu-search-submit{ width:100%; }
}

@media (max-width:575.98px){
  .header-shell{ padding:7px 10px 6px; }

  .header-bar{
    min-height:44px;
    gap:7px;
  }

  .header-menu-toggle{
    width:34px;
    min-width:34px;
    min-height:34px;
    padding:0;
    gap:0;
  }

  .header-brand-eyebrow{ display:none; }
  .header-brand-title{ font-size:clamp(1rem,5vw,1.35rem); }

  .header-login-link{
    width:34px;
    min-width:34px;
    min-height:34px;
    padding:0;
    justify-content:center;
  }

  .header-date-kicker{ font-size:7px; }
  .header-date-main{ font-size:9px; }

  .header-menu-link{ min-height:48px; font-size:.96rem; }
  .header-menu-section-toggle{ min-height:46px; font-size:.96rem; }
  .header-menu-category-link{ min-height:42px; font-size:.92rem; }
  .header-menu-lang{ min-height:40px; font-size:.84rem; padding:0 8px; }
  .header-menu-tool{ min-height:44px; font-size:.92rem; }
}

/* =========================================================
   HANDOFF TO CONTENT
========================================================= */

.site-header + .header-menu-backdrop + .header-menu-panel + main.site-frame,
.site-header + main.site-frame{
  margin-top:0;
  padding-top:0;
  background:transparent;
}

.site-header + main.site-frame > *:first-child,
.site-header + .header-menu-backdrop + .header-menu-panel + main.site-frame > *:first-child,
.site-header + main.site-frame > .obituary-page-unified:first-child,
.site-header + .header-menu-backdrop + .header-menu-panel + main.site-frame > .obituary-page-unified:first-child{
  margin-top:0 !important;
}