/* =========================================================================
   Summit Institute blog: header, menu and footer.
   Copied from the main site's assets/css/brand.css so the blog's top and
   bottom match summitinstitute.ac.nz exactly. Post styling lives in
   Appearance > Customize > Additional CSS.
   ========================================================================= */

:root {
  --bg: #ffffff;
  --surface: #f3f7f2;
  --ink: #1b1f1c;
  --muted: #536058;
  --line: #dde6db;
  --green: #00bc36;
  --green-deep: #007f25;
  --on-green: #ffffff;
  --display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --body: "Work Sans", "Segoe UI", system-ui, sans-serif;
}

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--bg); padding: 10px 16px; z-index: 50; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }

header.site .wrap, footer.site .wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
header.site *, footer.site * { box-sizing: border-box; }

/* Buttons used in the header */
header.site .btn, .mnav-panel .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--display) !important; font-weight: 600; font-size: 1rem;
  text-decoration: none !important; border-radius: 999px; padding: 13px 26px; min-height: 48px;
  transition: background .15s ease;
}
header.site .btn-join, .mnav-panel .btn-join { background: var(--green); color: var(--on-green) !important; border: 0; }
header.site .btn-join:hover, .mnav-panel .btn-join:hover { background: var(--green-deep); }

/* ---------- Header + menu ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
header.site { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); font-family: var(--body); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 10px; min-height: 64px; max-width: 1280px; }
header.site .brand, footer.site .brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; color: var(--ink) !important; flex-shrink: 0; }
header.site .brand img { height: 30px; width: auto; }
header.site .brand span, footer.site .brand span { font-family: var(--display); font-weight: 600; font-size: .95rem; line-height: 1.15; color: var(--ink) !important; }
header.site .brand small, footer.site .brand small { display: block; font-weight: 500; color: var(--muted); font-size: .76rem; }

header.site .menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
header.site .menu > li { position: relative; margin: 0; }
header.site .menu a, header.site .menu .sub-toggle {
  color: var(--ink) !important; text-decoration: none !important; font-family: var(--body) !important; font-weight: 500; font-size: .88rem;
  white-space: nowrap; background: none; border: 0; padding: 8px 9px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
header.site .menu a:hover, header.site .menu .sub-toggle:hover { color: var(--green-deep) !important; background: var(--surface); }
header.site .menu a[aria-current="page"], header.site .menu .is-current > .sub-toggle { color: var(--green-deep) !important; }
header.site .sub-toggle::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s ease; }
header.site .menu .has-sub:hover > .sub-toggle::after, header.site .menu .sub-toggle[aria-expanded="true"]::after { transform: translateY(1px) rotate(225deg); }
header.site .menu .sub { list-style: none; margin: 0; padding: 8px; position: absolute; top: calc(100% + 4px); left: 0; min-width: 270px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(20, 40, 25, .12); display: none; z-index: 30; }
header.site .menu .sub::before { content: ""; position: absolute; inset: -8px 0 auto; height: 8px; }
header.site .menu .sub a { display: flex; padding: 9px 12px; font-size: .92rem; white-space: normal; }
header.site .menu .sub li.sub-head { font-family: var(--display); font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 12px 4px; }
header.site .menu .has-sub:hover > .sub, header.site .menu .has-sub:focus-within > .sub, header.site .menu .has-sub.open > .sub { display: block; }
header.site .menu .btn-join { color: var(--on-green) !important; background: var(--green); margin-left: 8px; padding: 8px 20px; border-radius: 999px; min-height: 40px; font-family: var(--display) !important; font-weight: 600; }
header.site .menu .btn-join:hover { color: var(--bg) !important; background: var(--green-deep); }
header.site .menu > li:nth-last-child(-n+3) > .sub { left: auto; right: 0; }

/* Phone menu */
header.site .mnav { display: none; }
header.site .mnav summary { list-style: none; cursor: pointer; font-family: var(--display); font-weight: 600; font-size: .92rem; border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 16px; display: inline-flex; gap: 8px; align-items: center; color: var(--ink); }
header.site .mnav summary::-webkit-details-marker { display: none; }
header.site .mnav summary::before { content: "☰"; font-size: 1rem; line-height: 1; }
header.site .mnav[open] summary::before { content: "✕"; }
.mnav-panel { position: fixed; left: 0; right: 0; top: 64px; bottom: 0; overflow-y: auto; background: var(--bg); border-top: 1px solid var(--line); padding: 16px max(16px, env(safe-area-inset-left, 0px)) 40px; z-index: 40; }
.mnav-panel ul { list-style: none; margin: 0; padding: 0; }
.mnav-panel > ul > li { border-bottom: 1px solid var(--line); }
.mnav-panel a { display: block; padding: 12px 4px; color: var(--ink) !important; text-decoration: none !important; font-weight: 500; font-family: var(--body); }
.mnav-panel .grp { font-family: var(--display); font-weight: 600; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--green-deep); padding: 16px 4px 4px; }
.mnav-panel ul ul a { padding: 8px 4px 8px 14px; font-size: .95rem; color: var(--muted) !important; }
.mnav-panel .btn-join { margin-top: 20px; width: 100%; color: var(--on-green) !important; }
@media (max-width: 1240px) {
  header.site nav.desk { display: none; }
  header.site .mnav { display: block; }
}

/* ---------- Footer ---------- */
footer.site { border-top: 1px solid var(--line); background: var(--surface); font-size: .94rem; font-family: var(--body); color: var(--ink); }
footer.site .cols { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 32px; padding-block: 48px 32px; }
footer.site h2 { font-family: var(--display) !important; font-size: .78rem !important; letter-spacing: .12em; text-transform: uppercase; color: var(--muted) !important; font-weight: 600 !important; margin: 0 0 12px !important; }
footer.site ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
footer.site li { margin: 0; }
footer.site a { color: var(--ink) !important; text-decoration: none !important; }
footer.site a:hover { color: var(--green-deep) !important; text-decoration: underline !important; }
footer.site p { margin: 0; color: var(--muted) !important; }
footer.site .about { display: grid; gap: 14px; align-content: start; color: var(--muted); }
footer.site .about .brand img { height: 34px; width: auto; }
footer.site .base { border-top: 1px solid var(--line); padding-block: 18px 26px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; color: var(--muted); font-size: .88rem; }
footer.site .base nav { display: flex; gap: 18px; flex-wrap: wrap; }
@media (max-width: 860px) { footer.site .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } footer.site .about { grid-column: 1 / -1; } }
@media (max-width: 440px) { footer.site .cols { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { header.site *, footer.site * { transition: none !important; } }
@media print { header.site, footer.site, .mnav { display: none; } }
