/*
 * Mishpacha — Layout (header + footer)
 * Shared chrome on every page. Loaded after tokens.css.
 * Mobile overrides live in responsive.css.
 */

/* =============================================================
 * HEADER — single top bar with hamburger left, logo center,
 * search/login icons + subscribe button right.
 * ============================================================= */

header.mish-header {
  --hd-text:    #202020;
  --hd-sep:     #e0e0e0;

  width: 100%;
  background: #fff;
  position: relative;
  border-bottom: 1px solid var(--divider);
}
/* Header has two rows now: topbar + secondary nav.
 * Drop the bottom border on the topbar — only the outer header carries it. */

.mish-topbar {
  /* Same structure as the homepage masthead (Hila 2026-06-09): the topbar is
     a relatively-positioned block with the logo flowing inline (centered via
     text-align), and the icon groups absolutely positioned on the left/right
     sides. This keeps the logo anchored to the top padding line — flex
     centering placed it ~14px lower than the homepage equivalent. */
  width: 100%;
  padding: 18px 0 14px;
  text-align: center;
  position: relative;
  background: #fff;
}

/* Left-side group: hamburger + search icon, absolutely positioned at the
   viewport's left edge (Hila 2026-06-09 — match homepage masthead-side). */
.mish-topbar-l {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Hamburger (always visible, left side) ── */
.mish-hamburger {
  background: none;
  border: none;
  padding: 8px;
  margin-left: -8px;
  cursor: pointer;
  color: var(--hd-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
}
.mish-hamburger:hover { color: var(--red); }

/* Logo flows inline-block, centered by the topbar's text-align:center
   (Hila 2026-06-09 — mirror the homepage masthead's logo placement so the
   top + bottom whitespace matches). */
.mish-logo {
  display: inline-block;
}
.mish-logo a { text-decoration: none; display: block; }
.mish-logo img {
  /* Match the homepage masthead logo size (Hila 2026-06-09) so the banner
     reads the same across the site. clamp() keeps it sane on small screens. */
  height: clamp(72px, 9vw, 110px);
  width: auto;
  object-fit: contain;
  display: block;
}
.mish-logo-fallback {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 30px;
  color: var(--red);
  letter-spacing: -0.5px;
}

/* Right-side action group: login + Subscribe, absolutely positioned at the
   viewport's right edge (Hila 2026-06-09 — match homepage masthead-side-r). */
.mish-nav-actions {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Icon-only buttons (search, login) */
.mish-icon-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--hd-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: color .15s;
}
.mish-icon-btn:hover { color: var(--red); }
.mish-icon-btn svg { stroke: currentColor; display: block; }

/* Subscribe — pill button (Hila 2026-06-09 — match homepage masthead style). */
.mish-subscribe {
  background: var(--red);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  padding: 9px 20px;
  margin-left: 4px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.04em;
  transition: background .15s;
}
.mish-subscribe:hover { background: var(--red-dark); }

/* ── Secondary nav row — main categories (Hila 2026-05-18) ── */
.mish-nav {
  border-top: 1px solid var(--divider);
  background: #fff;
}
.mish-nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 38px;
}
.mish-nav ul {
  display: flex;
  align-items: center;
  /* Centered with a small gap matches the homepage category nav (Hila
     2026-06-09) — space-between was stretching items across 1440px and made
     the inside nav feel wider and more diffuse than the homepage one. */
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 48px;
  gap: 4px;
}
.mish-nav ul li a {
  position: relative;
  display: flex;
  align-items: center;
  /* Wider horizontal padding matches the homepage category nav spacing
     (Hila 2026-06-09). With justify-content:center on the row, this is what
     gives each label proper breathing room. */
  padding: 0 18px;
  height: 100%;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--ink);
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.06em;
  transition: color .15s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
.mish-nav ul li a::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .2s ease;
}
.mish-nav ul li a:hover,
.mish-nav ul li a.is-active {
  color: var(--red);
}
.mish-nav ul li a:hover::after,
.mish-nav ul li a.is-active::after {
  transform: scaleX(1);
}

/* ── Mobile search overlay (hidden by default; mobile CSS shows it) ── */
.mish-search-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 200;
  background: #fff;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}
.mish-search-overlay svg {
  flex-shrink: 0;
  opacity: .5;
  color: var(--hd-text);
}
.mish-search-overlay input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 16px;
  color: var(--hd-text);
  background: transparent;
  min-width: 0;
}
#mish-search-mob-close {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--red);
  padding: 8px 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Desktop expandable search form (sits inside .mish-nav-actions) ── */
#mish-search-form {
  display: none; /* JS flips to flex when trigger is clicked */
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--hd-text);
  border-radius: 2px;
  overflow: hidden;
  width: 260px;
}
#mish-search-form input {
  flex: 1;
  border: none;
  outline: none;
  padding: 8px 12px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 15px;
  color: var(--hd-text);
  background: transparent;
  min-width: 0;
}
#mish-search-form input::placeholder,
.mish-search-overlay input::placeholder {
  font-family: var(--font-serif);
  font-weight: 600;
  color: rgba(32, 32, 32, 0.45);
  opacity: 1;
}
#mish-search-form button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  color: var(--hd-text);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
#mish-search-close { color: #888 !important; padding: 6px 10px !important; }

/* =============================================================
 * DRAWER MENU — full-screen overlay (desktop + mobile)
 * Triggered by hamburger button. Fade + slide-down animation.
 * ============================================================= */
.mish-drawer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--paper);
  overflow-y: auto;
  /* Hidden by default — animated via opacity + pointer-events */
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}
.mish-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mish-drawer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 88px 64px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  /* Subtle slide-down for the content while the overlay fades in */
  transform: translateY(-14px);
  transition: transform .32s ease;
}
.mish-drawer.is-open .mish-drawer-inner {
  transform: translateY(0);
}

.mish-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 40px;
}
.mish-drawer-logo { text-decoration: none; display: block; }
.mish-drawer-logo img { height: 48px; width: auto; display: block; }
.mish-drawer-logo .mish-logo-fallback { font-size: 26px; }

/* Main categories — big serif links */
.mish-drawer-main ul,
.mish-drawer-extra ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mish-drawer-main ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 64px;
  row-gap: 0;
}
.mish-drawer-main li {
  border-bottom: 1px solid var(--divider);
}
.mish-drawer-main a {
  display: block;
  padding: 14px 0;
  /* Match the banner navigation typography per Hila (2026-06-04):
     Inter, uppercase, letter-spaced — same family + treatment as the
     primary category nav. */
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(15px, 1.3vw, 18px);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
  transition: color .15s, padding-left .2s;
}
.mish-drawer-main a:hover {
  color: var(--red);
  padding-left: 8px;
}

/* Lower section — smaller utility links */
.mish-drawer-extra {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--divider);
}
.mish-drawer-extra ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
}
.mish-drawer-extra a {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(29, 5, 6, 0.7);
  text-decoration: none;
  transition: color .15s;
}
.mish-drawer-extra a:hover { color: var(--red); }

/* =============================================================
 * FOOTER
 * ============================================================= */

#site-footer {
  --ft-border:   #3f3f3f;
  --ft-input-bd: #434343;
  --ft-input-tx: #585858;

  background: #222;
  color: #fff;
  padding: 88px 88px 20px;
}

#site-footer .footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--ft-border);
  margin-bottom: 18px;
}

/* Brand column */
#site-footer .footer-brand {
  width: 306px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}
#site-footer .footer-brand-logo {
  display: block;
  width: 200px;
  flex-shrink: 0;
}
#site-footer .footer-brand-logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}
/* Social icons row */
#site-footer .footer-social {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-left: 4px; /* visually anchor under the M in Mishpacha */
}
#site-footer .footer-social a {
  display: block;
  text-decoration: none;
}
#site-footer .footer-social img {
  display: block;
}

/* Nav columns wrapper */
#site-footer .footer-nav {
  display: flex;
  align-items: flex-start;
  gap: 80px;
}

#site-footer .footer-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 360px;
}
#site-footer .footer-sections .footer-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 24px;
  row-gap: 6px;
}
#site-footer .footer-company {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 160px;
}

/* Section heading (Sections / Company) */
#site-footer .footer-col-h {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16px;
  color: #fff;
  margin: 0;
  text-transform: uppercase;
}

/* Link list */
#site-footer .footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#site-footer .footer-links a {
  font-family: var(--font-sans);
  font-size: 16px;
  color: #fff;
  text-decoration: none;
  text-transform: capitalize;
  transition: color .15s;
}
#site-footer .footer-links a:hover {
  color: var(--red);
}


/* Bottom bar */
#site-footer .footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#site-footer .footer-copy {
  font-family: var(--font-sans);
  font-size: 14px;
  color: #fff;
  margin: 0;
  text-transform: capitalize;
  white-space: nowrap;
}
#site-footer .footer-legal {
  display: flex;
  gap: 26px;
  align-items: center;
}
#site-footer .footer-legal a {
  font-family: var(--font-sans);
  font-size: 14px;
  color: #fff;
  text-decoration: none;
  text-transform: capitalize;
  white-space: nowrap;
}
