/* The home page's header (static/css/home.css, .site-header.is-home) for the
   public pages that extend base.html, shown to visitors who are not logged in.
   home.css styles bare elements and Bootstrap class names (.btn, .container),
   so it cannot be loaded beside Bootstrap; these rules copy its header,
   buttons and Contact us dialog under mh- names. Keep the two in step: a
   change to the home header belongs here too. */

.mh-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: #FFFFFF;
  border-bottom: 1px solid rgba(42, 31, 34, 0.12);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .mh-header {
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
  }
}
.mh-header-inner {
  max-width: 1180px;
  margin-inline: auto;
  padding: 1.9rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.mh-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  font-family: var(--font-display);
  line-height: 1.6;
  text-decoration: none;
  text-align: left;
}
.mh-brand:hover { text-decoration: none; }
.mh-brand .brand-mark { width: 78px; height: 63px; display: block; }
.mh-brand-word {
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--brand-primary);
}
.mh-brand-word .word-accent { color: var(--brand-accent-strong); }
.mh-brand-tagline {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.mh-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}
.mh-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.6rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--brand-primary);
  text-decoration: none;
  white-space: nowrap;
}
.mh-link:hover { color: var(--brand-accent-strong); text-decoration: underline; }

.mh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 8px;
  padding: 0.8rem 1.4rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 160ms ease, background-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .mh-btn:hover { transform: translateY(-1px); }
}
.mh-btn:active { transform: scale(0.97); }
.mh-btn-primary {
  background: var(--brand-primary);
  color: #FFF7F5;
  box-shadow: 0 1px 2px rgba(42, 31, 34, 0.06), 0 1px 1px rgba(42, 31, 34, 0.04);
}
.mh-btn-primary:hover { color: #FFF7F5; box-shadow: 0 8px 24px rgba(42, 31, 34, 0.10); }
.mh-btn-outline {
  background: transparent;
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
.mh-btn-outline:hover { color: var(--brand-primary); background: rgba(122, 36, 56, 0.08); }
.mh-btn-outline.is-current { background: rgba(122, 36, 56, 0.08); }

@media (max-width: 640px) {
  .mh-header-inner { padding: 1.4rem 1.25rem; }
  .mh-brand .brand-mark { width: 58px; height: 47px; }
  .mh-brand-word { font-size: 1.3rem; }
}
/* Never hide the actions on narrow phones: wrap them onto a second row. */
@media (max-width: 520px) {
  .mh-header-inner { flex-wrap: wrap; row-gap: 0.75rem; justify-content: center; }
  .mh-brand { align-items: center; text-align: center; }
  .mh-actions { width: 100%; margin-left: 0; flex-wrap: wrap; justify-content: center; }
  .mh-btn { white-space: normal; justify-content: center; }
}

/* Contact us dialog, as on the home page */
.mh-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  border: none;
  border-radius: 22px;
  padding: 2rem;
  width: min(560px, 90vw);
  max-height: calc(100vh - 3.25rem);
  overflow-y: auto;
  background: #FFFFFF;
  color: var(--ink);
  box-shadow: 0 16px 40px rgba(42, 31, 34, 0.16);
}
.mh-modal::backdrop { background: rgba(20, 8, 12, 0.45); }
.mh-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.mh-modal-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
  line-height: 1.12;
  color: var(--brand-primary);
}
.mh-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: none;
  border: 1px solid rgba(42, 31, 34, 0.12);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
}
.mh-modal-close svg { width: 20px; height: 20px; }
.mh-contact-list { display: grid; gap: 1.25rem; }
.mh-contact-item { display: flex; gap: 0.75rem; align-items: flex-start; }
.mh-contact-item .icon { width: 26px; height: 26px; color: var(--brand-primary); flex-shrink: 0; margin-top: 0.15rem; }
.mh-contact-item h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 0.15rem;
  color: var(--brand-primary);
}
.mh-contact-item p { font-size: 0.95rem; margin: 0; color: var(--ink-soft); }
.mh-contact-item p a { color: var(--brand-primary); font-weight: 600; text-decoration: none; }
.mh-contact-item p a:hover { text-decoration: underline; }

/* Compact header on phones, as on the home page (home.css, "Compact header on
   phones"): once scrolled, one slim row with the small mortarboard and the
   three actions. base.html's inline script adds .is-compact. */
@media (max-width: 520px) {
  .mh-header.is-compact .mh-header-inner {
    flex-wrap: nowrap;
    justify-content: space-between;
    column-gap: 0.5rem;
    padding-block: 0.5rem;
  }
  .mh-header.is-compact .mh-brand-word,
  .mh-header.is-compact .mh-brand-tagline { display: none; }
  .mh-header.is-compact .mh-brand { flex-shrink: 0; }
  .mh-header.is-compact .mh-brand .brand-mark { width: 38px; height: 31px; }
  .mh-header.is-compact .mh-actions { width: auto; flex-wrap: nowrap; gap: 0.35rem; }
  .mh-header.is-compact .mh-link { min-height: 36px; padding: 0 0.35rem; font-size: 0.9rem; }
  .mh-header.is-compact .mh-btn {
    white-space: nowrap;
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
  }
}
/* The narrowest phones (320px): a little less room round the compact row. */
@media (max-width: 360px) {
  .mh-header.is-compact .mh-header-inner { padding-inline: 0.75rem; column-gap: 0.35rem; }
  .mh-header.is-compact .mh-actions { gap: 0.25rem; }
  .mh-header.is-compact .mh-link { padding: 0 0.25rem; }
  .mh-header.is-compact .mh-btn { padding: 0.4rem 0.55rem; }
}
