/* ===========================================================
   JOVIT mobile polish
   Real fixes for phone-sized screens: tap targets, minimum type,
   anchor offsets under the fixed header, notch-safe fixed bars and
   calmer image rendering. Loaded last so it wins.
   =========================================================== */

/* ---- 1. Anchors must not land under the fixed header ---- */
html {
  scroll-padding-top: calc(var(--xmas-crown, 0px) + 96px);
}

/* ---- 2. Tap targets: nothing interactive under 44px ---- */
/* Inline text links keep their line height, so only padded hits grow. */
.footer-col ul li a,
.footer-social a,
.mini-info-card a,
.cta-phone,
.nav-links a,
.breadcrumb a,
.inline-link,
.tel-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.footer-social a {
  width: 44px;
  height: 44px;
  justify-content: center;
}
/* Phone numbers and site links inside info cards were 17px tall */
.mini-info-card .info-row a,
.mini-info-card p a,
a[href^="tel:"],
a[href^="https://harriet"] {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 2px 0;
}

/* ---- 3. Minimum legible type on small screens ---- */
@media (max-width: 640px) {
  .card-type-badge,
  .region-tag,
  .mini-badge,
  .eyebrow,
  .section-tag,
  .hero-badge,
  .stat-label,
  .card-rating,
  .badge {
    font-size: 12px;
    letter-spacing: 0.06em;
  }
  .estab-card .card-body .card-desc,
  .feature-card p,
  .footer-col p {
    font-size: 15px;
    line-height: 1.65;
  }
}

/* ---- 4. Fixed bars clear the iPhone home indicator ---- */
body.has-mobile-cta .mobile-cta,
.mobile-cta-bar,
.branch-bar,
.bottom-bar {
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}
body.has-mobile-cta {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
.mobile-cta,
.mobile-cta-bar,
.branch-bar {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* ---- 5. Rendering: images never jump, never upscale past their source ---- */
img {
  height: auto;
  max-width: 100%;
  content-visibility: auto;
}
img[loading="lazy"] { content-visibility: auto; }

/* ---- 6. Long words and URLs must not push the layout ---- */
p, li, h1, h2, h3, h4, .card-desc, .mini-info-card {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---- 7. Scrolling feels native, not sticky ---- */
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: none; }

/* phone and site links inside cards: guarantee the full 44px */
.mini-info-card a[href^="tel:"],
.mini-info-card a[href^="http"],
a[href^="tel:"] {
  min-height: 44px !important;
  padding: 12px 0 !important;
  line-height: 1.2;
}

/* ---- the remaining sub-11px labels on the homepage ---- */
@media (max-width: 640px) {
  .hero-badge,
  .v2-scroll-cue,
  .v2-marquee-item { font-size: 12px !important; letter-spacing: 0.07em; }
  /* branch chips were 38px wide */
  .branch-chip, .v2-chip, .filter-chip, .pill { min-width: 44px; min-height: 44px; }
}
/* injected card imagery: reserve the box so nothing jumps */
.estab-card .card-banner,
.site-card-preview { aspect-ratio: 16 / 10; }
.estab-card .card-banner img,
.site-card-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---- final stragglers ---- */
@media (max-width: 900px) {
  .v2-marquee-item, .hero-badge, .v2-scroll-cue { font-size: 12px !important; }
}
/* bare anchors (branch filters) and card links get a real hit area */
a:not([class]) {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mini-info-card a[href^="tel:"],
.cta-phone,
a[href^="tel:"] {
  min-height: 44px !important;
  padding: 14px 0 !important;
}
/* the external site link in the info card */
a[href*="harriet-suite"],
a[href*=".web.app"] {
  min-height: 44px !important;
  padding: 14px 0 !important;
  display: inline-flex;
  align-items: center;
}

/* ===========================================================
   Mobile nav: the drawer was anchored to a hardcoded 75px while
   the seasonal crown pushes the bar to 56px, so it opened on top
   of the nav. Anchor it to the bar, keep it out of the layout when
   closed, and make the toggle a real target.
   =========================================================== */
@media (max-width: 768px) {
  body:not(.branch-page) { --nav-box: 65px; }
  body.branch-page { --nav-box: var(--nav-h, 76px); }

  /* closed: not visible, not tappable, not in the tab order */
  .nav-links {
    visibility: hidden;
    pointer-events: none;
    /* the bar carries a transform, so it is the containing block for this
       fixed panel: 100% of it lands exactly on the bar's bottom edge */
    top: 100% !important;
    max-height: calc(100vh - var(--xmas-crown, 0px) - var(--nav-box, 65px));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links.open,
  body.nav-open .nav-links {
    visibility: visible;
    pointer-events: auto;
  }
  /* the bar itself: room to breathe, nothing crushed */
  .navbar .container { gap: 12px; padding-left: 16px; padding-right: 16px; }
  .logo { min-width: 0; flex-shrink: 1; }
  .logo .logo-text { font-size: 1.2rem; letter-spacing: 1px; }
  .logo .logo-mark { width: 38px; height: 38px; }
  .menu-toggle {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
  }
  /* the seasonal cap sits on the mark's shoulder, clear of the face */
  .season-xmas .logo::after { width: 26px; height: 24px; top: -16px; left: 12px; transform: rotate(-10deg); }
}

/* On phones keep BOTH the bulbs and the greeting, but compact: a slimmer
   garland (18px) over a shorter strip (26px) costs 48px instead of 56px, so the
   lights stay visible without eating the screen. */
@media (max-width: 640px) {
  .xmas-lights {
    display: block !important;
    height: 18px !important;
    background-size: 168px 18px, 168px 18px, 168px 18px, 168px 18px, 168px 18px, 100% 1.5px !important;
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 1px !important;
  }
  .season-xmas .xmas-ticker {
    inset: 22px 0 auto 0 !important;
    height: 26px !important;
  }
  .season-xmas .xmas-ticker-track span { line-height: 26px !important; font-size: 12.5px !important; }
  :root { --xmas-crown: 48px; }
  .season-xmas .navbar { top: var(--xmas-crown); }
  .season-xmas .hero { padding-top: calc(65px + var(--xmas-crown)); }
  .season-xmas body.branch-page .navbar { top: var(--xmas-crown); }
  .season-xmas body.branch-page .hero { padding-top: calc(var(--nav-h, 76px) + var(--xmas-crown)); }
}

/* Harriet's hero is section.mini-hero.hotel with a flat 70px top padding,
   which leaves its heading almost touching the bar once the crown is added. */
@media (max-width: 768px) {
  .season-xmas section.mini-hero {
    padding-top: calc(var(--xmas-crown, 0px) + var(--nav-box, 65px) + 28px) !important;
  }
}

/* ===========================================================
   MOBILE RESET (4 Dec, evening)
   The earlier pass bolted a fixed garland + strip above the bar and
   pushed the nav down 48px. On a phone that reads as a broken layout:
   the page starts 48px low and the bar is detached from the top.
   This block supersedes all of that with one rule: the bar sits at the
   top edge, the greeting rides just under it, nothing is offset.
   =========================================================== */
@media (max-width: 640px) {
  :root { --xmas-crown: 0px; }

  /* no bulb garland on phones: it was pure clutter at 18px */
  .season-xmas .xmas-lights { display: none !important; }

  /* the greeting stays, pinned directly under the bar, not above it */
  .season-xmas .xmas-ticker {
    position: fixed !important;
    top: var(--nav-box, 65px) !important;
    left: 0 !important;
    right: 0 !important;
    height: 24px !important;
    margin: 0 !important;
    border-top: 1px solid rgba(212, 175, 55, 0.35) !important;
  }
  .season-xmas .xmas-ticker-track span {
    line-height: 24px !important;
    font-size: 12px !important;
    padding-right: 48px !important;
  }

  /* the bar returns to the top edge, as designed */
  .season-xmas .navbar,
  .season-xmas body.branch-page .navbar {
    top: 0 !important;
    margin-top: 0 !important;
  }

  /* content clears the bar + the 24px strip, and nothing more */
  .season-xmas .hero,
  .season-xmas body.branch-page .hero,
  .season-xmas section.mini-hero {
    padding-top: calc(var(--nav-box, 65px) + 24px + 20px) !important;
  }
  .season-xmas .page-hero,
  .season-xmas .branch-hero { margin-top: 0 !important; }

  /* the drawer opens below the strip, not under it */
  .nav-links { top: calc(100% + 24px) !important; }
  .nav-links.open, body.nav-open .nav-links { top: calc(100% + 24px) !important; }
}
