/* ============================================================================
   MEGA MENU 01 - CLASSIC PRACTICE PANEL  (drop-in dental header component)
   Light full-width panel, three service-group columns, featured offer card
   with a photo, bottom strip with hours + phone + Book.
   Header behaviour: headroom (hides on scroll down, returns on scroll up,
   compacts when stuck). Switch with --mm-header-mode: pinned.

   Restyle by overriding tokens only. Nothing below :root is hard-coded.
   ========================================================================== */

:root {
  /* palette: Clearbrook Family Dental. Warm ivory + clay, breaks the dental
     sky-blue default. Every colour is a token. */
  --mm-surface: #ffffff;          /* the panel surface, always opaque */
  --mm-surface-2: #faf6ef;        /* warm ivory, hover + strip fill */
  --mm-bar: #ffffff;              /* header bar fill */
  --mm-ink: #221e19;              /* headings, link names */
  --mm-body: #5a5349;             /* blurbs, secondary copy (4.9:1 on ivory) */
  --mm-muted: #7a7265;            /* kickers */
  --mm-accent: #b4593a;           /* clay. Fill colour on this system. */
  --mm-accent-ink: #ffffff;       /* text on accent */
  --mm-accent-soft: #f4e7e0;      /* icon chip fill */
  --mm-line: #e4ddd1;             /* hairlines */
  --mm-scrim: rgba(34, 30, 25, .34); /* page scrim behind the open panel */

  /* type */
  --mm-font-display: "Marcellus", Georgia, serif;
  --mm-font-body: "Source Sans 3", system-ui, sans-serif;
  --mm-fs-link: 16px;
  --mm-fs-blurb: 13.5px;
  --mm-fs-kicker: 11px;
  --mm-fs-nav: 16px;

  /* metrics */
  --mm-container: 1280px;         /* panel spans this, same as the site container */
  --mm-gutter: 24px;
  --mm-pad: 28px;
  --mm-col-min: 280px;            /* hard floor for a service column */
  --mm-radius: 12px;
  --mm-radius-sm: 9px;
  --mm-icon: 24px;                /* icon glyph size */
  --mm-chip: 42px;                /* icon chip size */
  --mm-hdr-h: 84px;               /* header height at rest */
  --mm-hdr-h-stuck: 66px;         /* compacted height once stuck */
  --mm-shadow: 0 1px 2px rgba(34, 30, 25, .05), 0 28px 60px -24px rgba(34, 30, 25, .32);
  --mm-shadow-bar: 0 1px 0 var(--mm-line), 0 10px 26px -18px rgba(34, 30, 25, .5);

  /* motion */
  --mm-t-fast: 150ms;
  --mm-t: 220ms;
  --mm-ease: cubic-bezier(.16, 1, .3, 1);

  /* behaviour switch: headroom | pinned */
  --mm-header-mode: headroom;
  --mm-bp: 1080px;                /* below this the drawer takes over */
}

/* ---------------------------------------------------------------- header - */
.mm-hdr {
  position: sticky;
  top: 0;
  z-index: 120;
  background: var(--mm-bar);
  border-bottom: 1px solid var(--mm-line);
  font-family: var(--mm-font-body);
  transition: transform var(--mm-t) var(--mm-ease), box-shadow var(--mm-t) var(--mm-ease);
  will-change: transform;
}
.mm-hdr.is-stuck { box-shadow: var(--mm-shadow-bar); border-bottom-color: transparent; }
.mm-hdr.is-hidden { transform: translateY(-101%); }

.mm-hdr__in {
  max-width: var(--mm-container);
  margin: 0 auto;
  padding: 0 var(--mm-gutter);
  height: var(--mm-hdr-h);
  display: flex;
  align-items: center;
  gap: 28px;
  transition: height var(--mm-t) var(--mm-ease);
}
.mm-hdr.is-stuck .mm-hdr__in { height: var(--mm-hdr-h-stuck); }

.mm-logo { display: flex; align-items: center; gap: 11px; flex-shrink: 0; text-decoration: none; color: var(--mm-ink); }
.mm-logo svg { width: 30px; height: 30px; color: var(--mm-accent); flex-shrink: 0; }
.mm-logo b { font-family: var(--mm-font-display); font-weight: 400; font-size: 21px; letter-spacing: .005em; white-space: nowrap; }
.mm-logo span { display: block; font-size: 10.5px; letter-spacing: .17em; text-transform: uppercase; color: var(--mm-muted); margin-top: 2px; }

.mm-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.mm-nav__item { position: static; }
.mm-nav__link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 12px; min-height: 44px;
  font-size: var(--mm-fs-nav); font-weight: 400; color: var(--mm-ink);
  text-decoration: none; white-space: nowrap; border-radius: var(--mm-radius-sm);
  transition: color var(--mm-t-fast) ease, background var(--mm-t-fast) ease;
}
.mm-nav__link:hover { color: var(--mm-accent); }
.mm-nav__link svg { width: 13px; height: 13px; transition: transform var(--mm-t) var(--mm-ease); }
.mm-nav__link[aria-expanded="true"] { color: var(--mm-accent); background: var(--mm-surface-2); }
.mm-nav__link[aria-expanded="true"] svg { transform: rotate(180deg); }

.mm-hdr__util { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.mm-tel {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  color: var(--mm-ink); font-size: 15.5px; font-weight: 600; white-space: nowrap;
}
.mm-tel svg { width: 18px; height: 18px; color: var(--mm-accent); }
.mm-tel:hover { color: var(--mm-accent); }
.mm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--mm-accent);
  background: var(--mm-accent); color: var(--mm-accent-ink);
  font-family: var(--mm-font-body); font-size: 15px; font-weight: 600;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background var(--mm-t-fast) ease, transform var(--mm-t-fast) ease;
}
.mm-btn:hover { background: #9c4a2f; border-color: #9c4a2f; }
.mm-btn:active { transform: scale(.97); }
.mm-btn--ghost { background: transparent; color: var(--mm-ink); border-color: var(--mm-line); }
.mm-btn--ghost:hover { background: var(--mm-surface-2); border-color: var(--mm-accent); color: var(--mm-accent); }

.mm-burger {
  display: none; width: 46px; height: 46px; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--mm-line); border-radius: var(--mm-radius-sm);
  color: var(--mm-ink); cursor: pointer;
}
.mm-burger svg { width: 22px; height: 22px; }

/* ----------------------------------------------------------------- panel - */
.mm-panel {
  position: absolute;
  top: 100%;                 /* flush to the nav bar's bottom edge */
  left: 0; right: 0;
  z-index: 121;
  display: block;
  background: var(--mm-surface);            /* solid, opaque. Never translucent. */
  border-top: 1px solid var(--mm-line);
  box-shadow: var(--mm-shadow);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-8px);
  transition: opacity var(--mm-t) var(--mm-ease), transform var(--mm-t) var(--mm-ease), visibility var(--mm-t);
}
.mm-hdr.is-open .mm-panel[data-mm-open] { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.mm-panel__in {
  max-width: var(--mm-container);
  margin: 0 auto;
  padding: var(--mm-pad) var(--mm-gutter) 0;
  display: grid;
  gap: var(--mm-gutter);
  grid-template-columns: repeat(2, minmax(var(--mm-col-min), 1fr)) minmax(300px, 330px);
}
.mm-panel__col:nth-of-type(3) { grid-column: 1; }
.mm-feat { grid-column: 3; grid-row: 1 / span 2; }
@media (min-width: 1340px) {
  .mm-panel__in { grid-template-columns: repeat(3, minmax(var(--mm-col-min), 1fr)) minmax(300px, 330px); }
  .mm-panel__col:nth-of-type(3) { grid-column: auto; }
  .mm-feat { grid-column: 4; grid-row: 1; }
}

.mm-kicker {
  display: block; font-size: var(--mm-fs-kicker); font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--mm-muted);
  margin: 0 0 10px 12px;
}
.mm-links { list-style: none; margin: 0; padding: 0; }
.mm-link {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 9px 12px; border-radius: var(--mm-radius-sm);
  text-decoration: none; border: 1px solid transparent;
  transition: background var(--mm-t-fast) ease, border-color var(--mm-t-fast) ease;
}
.mm-link__ic {
  flex: none; width: var(--mm-chip); height: var(--mm-chip); border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--mm-accent-soft); color: var(--mm-accent);
  transition: background var(--mm-t-fast) ease, color var(--mm-t-fast) ease;
}
.mm-link__ic svg { width: var(--mm-icon); height: var(--mm-icon); }
.mm-link__tx { min-width: 0; }
.mm-link__tx b {
  display: block; font-size: var(--mm-fs-link); font-weight: 600; color: var(--mm-ink);
  line-height: 1.3; white-space: nowrap;
}
.mm-link__tx span {
  display: block; font-size: var(--mm-fs-blurb); line-height: 1.45; color: var(--mm-body);
  margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mm-link:hover { background: var(--mm-surface-2); border-color: var(--mm-line); }
.mm-link:hover .mm-link__ic { background: var(--mm-accent); color: var(--mm-accent-ink); }
.mm-link:hover .mm-link__tx b { color: var(--mm-accent); }

/* featured card ------------------------------------------------------------ */
.mm-feat {
  display: flex; flex-direction: column;
  background: var(--mm-surface-2); border: 1px solid var(--mm-line);
  border-radius: var(--mm-radius); overflow: hidden;
}
.mm-feat__img { display: block; width: 100%; height: 168px; object-fit: cover; }
.mm-feat__bd { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.mm-feat__eyebrow {
  font-size: var(--mm-fs-kicker); font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--mm-accent);
}
.mm-feat__title {
  font-family: var(--mm-font-display); font-weight: 400; font-size: 24px; line-height: 1.15;
  color: var(--mm-ink); margin: 9px 0 0;
}
.mm-feat__body { font-size: var(--mm-fs-blurb); line-height: 1.5; color: var(--mm-body); margin: 9px 0 16px; }
.mm-feat__cta { margin-top: auto; width: 100%; }
.mm-feat__fine { font-size: 11.5px; color: var(--mm-muted); margin: 10px 0 0; line-height: 1.4; }

/* bottom strip ------------------------------------------------------------- */
.mm-strip {
  margin-top: var(--mm-pad);
  border-top: 1px solid var(--mm-line);
  background: var(--mm-surface-2);
}
.mm-strip__in {
  max-width: var(--mm-container); margin: 0 auto;
  padding: 14px var(--mm-gutter);
  display: flex; align-items: center; gap: 28px; flex-wrap: nowrap;
}
.mm-strip__fact { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--mm-body); white-space: nowrap; }
.mm-strip__fact svg { width: 22px; height: 22px; color: var(--mm-accent); flex: none; }
.mm-strip__fact b { color: var(--mm-ink); font-weight: 600; }
.mm-strip__end { margin-left: auto; display: flex; align-items: center; gap: 14px; }

/* page scrim while the panel is open --------------------------------------- */
.mm-scrim {
  position: fixed; inset: 0; z-index: 110;
  background: var(--mm-scrim);
  opacity: 0; visibility: hidden;
  transition: opacity var(--mm-t) var(--mm-ease), visibility var(--mm-t);
}
.mm-scrim[data-mm-open] { opacity: 1; visibility: visible; }

/* ---------------------------------------------------------------- drawer - */
.mm-drawer {
  position: fixed; inset: 0; z-index: 200; display: none;
  font-family: var(--mm-font-body);
}
.mm-drawer[data-open] { display: block; }
.mm-drawer__scrim { position: absolute; inset: 0; background: var(--mm-scrim); }
.mm-drawer__panel {
  position: absolute; inset: 0 0 0 auto; width: min(420px, 100%);
  background: var(--mm-surface); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform var(--mm-t) var(--mm-ease);
  overflow-y: auto;
}
.mm-drawer[data-open] .mm-drawer__panel { transform: none; }
.mm-drawer__top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--mm-gutter); border-bottom: 1px solid var(--mm-line);
  position: sticky; top: 0; background: var(--mm-surface); z-index: 2;
}
.mm-drawer__close {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  background: transparent; border: 1px solid var(--mm-line); border-radius: var(--mm-radius-sm);
  color: var(--mm-ink); font-size: 14px; font-weight: 600; cursor: pointer;
}
.mm-drawer__close svg { width: 18px; height: 18px; }
.mm-drawer__nav { padding: 8px var(--mm-gutter) 24px; }
.mm-drawer__nav > a {
  display: block; padding: 14px 0; font-size: 18px; color: var(--mm-ink);
  text-decoration: none; border-bottom: 1px solid var(--mm-line);
}
.mm-acc {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; background: transparent; border: 0; border-bottom: 1px solid var(--mm-line);
  font-family: inherit; font-size: 18px; color: var(--mm-ink); cursor: pointer; text-align: left;
}
.mm-acc svg { width: 18px; height: 18px; color: var(--mm-muted); transition: transform var(--mm-t) var(--mm-ease); }
.mm-acc[aria-expanded="true"] svg { transform: rotate(180deg); }
.mm-acc__body { display: none; padding: 6px 0 14px; border-bottom: 1px solid var(--mm-line); }
.mm-acc__body[data-open] { display: block; }
.mm-acc__body .mm-kicker { margin: 14px 0 6px 0; }
.mm-acc__body .mm-link { padding: 10px 0; }
.mm-acc__body .mm-link:hover { background: transparent; border-color: transparent; }
.mm-drawer__cta { padding: 20px var(--mm-gutter) 32px; border-top: 1px solid var(--mm-line); background: var(--mm-surface-2); margin-top: auto; }
.mm-drawer__cta .mm-btn { width: 100%; margin-bottom: 12px; }
.mm-drawer__cta .mm-tel { justify-content: center; width: 100%; height: 46px; }

/* focus visibility --------------------------------------------------------- */
.mm-hdr a:focus-visible, .mm-hdr button:focus-visible,
.mm-panel a:focus-visible, .mm-drawer a:focus-visible, .mm-drawer button:focus-visible {
  outline: 2px solid var(--mm-accent); outline-offset: 2px; border-radius: 6px;
}

/* ------------------------------------------------------------ responsive - */
@media (max-width: 1079px) {
  .mm-nav, .mm-hdr__util .mm-btn, .mm-hdr__util .mm-tel span { display: none; }
  .mm-burger { display: inline-flex; }
  .mm-panel { display: none; }
  .mm-hdr__in { height: 68px; gap: 14px; }
  :root { --mm-hdr-h: 68px; --mm-hdr-h-stuck: 60px; }
  .mm-hdr__util { gap: 10px; }
  .mm-tel { width: 46px; height: 46px; justify-content: center; border: 1px solid var(--mm-line); border-radius: var(--mm-radius-sm); }
}
@media (max-width: 420px) {
  .mm-logo b { font-size: 18px; }
  .mm-logo span { font-size: 9.5px; letter-spacing: .14em; }
}

@media (prefers-reduced-motion: reduce) {
  .mm-hdr, .mm-hdr__in, .mm-panel, .mm-scrim, .mm-drawer__panel,
  .mm-link, .mm-link__ic, .mm-btn, .mm-nav__link, .mm-nav__link svg, .mm-acc svg {
    transition: none !important;
  }
}
