/* Shared masthead for every Rent vs Buy page.
   Lives in one file so the landing page and the calculator cannot drift apart
   in height, colour or spacing. Both pages define --teal-d themselves, but the
   fallbacks are here so this file works standing alone. */

/* The gradient hairline above the masthead. Sticky on its own, so it stays as
   a thin teal-to-orange line at the top of the window once the header itself
   has scrolled away. */
.stripe {
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--teal, #0D5068) 0%, var(--orange, #D4501A) 100%);
  position: sticky;
  top: 0;
  z-index: 30;
}

.masthead {
  background: var(--teal-d, #093A4C);
  color: #F4EFE6;
  position: relative;
  z-index: 20;
}

.mast-in {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
}

.masthead a { color: #F4EFE6; text-decoration: none; }

.masthead .brand { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.masthead .brand img { width: 30px; height: 30px; border-radius: 7px; display: block; }
.masthead .brand strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
}

.mast-nav { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.mast-nav a { padding: 4px 0; border-bottom: 1px solid transparent; }
.mast-nav a:hover { border-bottom-color: #F4EFE6; }
/* The link to the page you are already on stays readable but stops inviting
   a click, rather than being removed and making the nav differ per page. */
.mast-nav a[aria-current="page"] { opacity: .6; border-bottom-color: transparent; cursor: default; }

/* ── Hamburger ──────────────────────────────────────────────────────────── */

.mast-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  margin: -8px -8px -8px 0;
  cursor: pointer;
  color: #F4EFE6;
  border-radius: 8px;
}
.mast-toggle:focus-visible { outline: 2px solid #F4EFE6; outline-offset: 1px; }
.mast-toggle .bars { display: block; width: 22px; height: 16px; position: relative; }
.mast-toggle .bars i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .18s ease, opacity .18s ease, top .18s ease;
}
.mast-toggle .bars i:nth-child(1) { top: 0; }
.mast-toggle .bars i:nth-child(2) { top: 7px; }
.mast-toggle .bars i:nth-child(3) { top: 14px; }

/* Becomes a cross while the menu is open, so the control says what it does. */
.masthead.open .mast-toggle .bars i:nth-child(1) { top: 7px; transform: rotate(45deg); }
.masthead.open .mast-toggle .bars i:nth-child(2) { opacity: 0; }
.masthead.open .mast-toggle .bars i:nth-child(3) { top: 7px; transform: rotate(-45deg); }

/* 760 rather than 700: five links plus the brand need 633px, which clears
   700px by only 20px and would overflow the moment a font loads wider. */
@media (max-width: 760px) {
  .mast-toggle { display: block; }

  /* Anchored under the button that opened it rather than spanning the screen:
     the toggle sits top right, so the thumb is already there. `right: 16px`
     lines the panel up with the toggle's own edge, which the negative margin
     pushes 8px into the gutter. */
  .mast-nav {
    display: none;
    position: absolute;
    top: calc(100% - 4px);
    right: 16px;
    left: auto;
    min-width: 190px;
    max-width: min(78vw, 280px);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--teal-d, #093A4C);
    border: 1px solid rgba(244,239,230,.18);
    border-radius: 12px;
    box-shadow: 0 14px 32px rgba(9,58,76,.38);
    padding: 6px;
    overflow: hidden;
  }
  .masthead.open .mast-nav { display: flex; }

  .mast-nav a {
    padding: 12px 14px;
    border-bottom: 0;
    border-radius: 8px;
    font-size: 15px;
    text-align: right;
  }
  .mast-nav a:hover { background: rgba(244,239,230,.09); border-bottom-color: transparent; }
  .mast-nav a[aria-current="page"]:hover { background: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mast-toggle .bars i { transition: none; }
}
