/* =====================================================================
   NatBridge Law LLP — V302 layer
   1. Gentle motion (the design itself is unchanged)
   2. Small fixes
   ===================================================================== */

/* ---------- 1. Gentle motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* Hero copy settles in once on page load */
  .nb-hero-copy, .hero .hero-inner, .about-page-hero-copy {
    animation: nbm-settle .6s ease-out both;
  }
  @keyframes nbm-settle { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

  /* Below-the-fold content fades up softly (classes added by js/effects.js) */
  .nbm-reveal:not(.nbm-done) {
    transition: opacity .55s ease-out, transform .55s ease-out !important;
    transition-delay: var(--nbm-d, 0ms) !important;
  }
  .nbm-reveal:not(.nbm-in) { opacity: 0 !important; transform: translateY(6px) !important; }

  /* Header shadow once scrolled */
  .nb-header { transition: box-shadow .35s ease; }
  .nb-header.nbm-scrolled { box-shadow: 0 6px 18px -10px rgba(20, 9, 3, .55); }

  /* Soft hover response on cards, photos and buttons */
  .nb-expertise-card, .nb-practice-tile, .nb-contact-item, .nb-contact-assurance {
    transition: transform .35s ease, box-shadow .35s ease;
  }
  @media (hover: hover) {
    .nb-expertise-card:hover, .nb-practice-tile:hover { transform: translateY(-1px); }
  }
  .nb-v026-photo { transition: transform .8s cubic-bezier(.2,.7,.2,1); }
  @media (hover: hover) { .nb-practice-tile:hover .nb-v026-photo { transform: scale(1.012); } }
  .nb-v043-hero-btn, .nb-about-button, .nb-correspondence-btn, .nb-contact-submit {
    transition: transform .25s ease, filter .25s ease, box-shadow .25s ease, background-color .25s ease, color .25s ease;
  }
  @media (hover: hover) {
    .nb-v043-hero-btn:hover, .nb-about-button:hover, .nb-correspondence-btn:hover { transform: translateY(-1px); }
  }
}

/* ---------- 2. Small fixes ---------- */
/* Disclaimer "declined" message */
.nbm-declined { text-align: center; padding: 6px; }
.nbm-declined h2 { font: 400 24px/1.25 Georgia, serif; margin: 0 0 12px; }
.nbm-declined p { font: 14px/1.7 Georgia, serif; margin: 0 0 8px; }
.nbm-review { margin-top: 12px; padding: 11px 20px; border: 1px solid #c9a063; background: transparent; color: inherit; border-radius: 4px; cursor: pointer; font: 13px Georgia, serif; letter-spacing: .06em; }

/* Practice page on phones: keep the areas in 01 → 08 order
   (ordered by the number printed on each card; the two desktop columns would otherwise stack as 01, 03, 05, 07, 02 …) */
@media (max-width: 900px) {
  html body.page-practice:not(#nbm) .nb-practice-grid { display: flex !important; flex-direction: column !important; }
  html body.page-practice:not(#nbm) .nb-practice-column { display: contents !important; }
  html body.page-practice:not(#nbm) #area-1 { order: 1 !important }
  html body.page-practice:not(#nbm) #area-3 { order: 2 !important }
  html body.page-practice:not(#nbm) #area-2 { order: 3 !important }
  html body.page-practice:not(#nbm) #area-8 { order: 4 !important }
  html body.page-practice:not(#nbm) #area-4 { order: 5 !important }
  html body.page-practice:not(#nbm) #area-6 { order: 6 !important }
  html body.page-practice:not(#nbm) #area-7 { order: 7 !important }
  html body.page-practice:not(#nbm) #area-5 { order: 8 !important }
}

/* ---------- 4. Smooth transitions between pages ----------
   Supporting browsers (Chrome, Edge, Safari 18+) cross-fade from one page to the next and keep
   the header in place, so moving around feels like one continuous site. Other browsers simply
   load the next page as usual. Switched off for "reduce motion". */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .nb-header { view-transition-name: nb-site-header; }
  /* The old page stays fully visible underneath while the new page fades in on top,
     so the light page background never shows through between the two dark heroes. */
  ::view-transition-old(root) { animation: none; opacity: 1; }
  ::view-transition-new(root) { animation: nbm-page-in .22s ease-out both; mix-blend-mode: normal; }
  ::view-transition-group(nb-site-header) { animation: none; }
}
@keyframes nbm-page-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 5. Practice page: jump links to each practice area ---------- */
html body.page-practice:not(.page-insights) .nb-practice-jump {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 20px;
}
html body.page-practice:not(.page-insights) .nb-practice-jump a {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid #caa56f; border-radius: 5px;
  background: #fcf4e8; color: #5b391f; font: 12.5px/1.2 Georgia, serif; text-decoration: none; white-space: nowrap;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, transform .25s ease;
}
html body.page-practice:not(.page-insights) .nb-practice-jump a b { font-weight: 700; color: #a56b2f; transition: color .25s ease; }
@media (hover: hover) {
  html body.page-practice:not(.page-insights) .nb-practice-jump a:hover { background: #4b2b19; color: #f4d6aa; border-color: #e1b87b; transform: translateY(-1px); }
  html body.page-practice:not(.page-insights) .nb-practice-jump a:hover b { color: #e6c28b; }
}
html body.page-practice:not(.page-insights) .nb-practice-tile { scroll-margin-top: 80px; }
@media (max-width: 767px) {
  html body.page-practice:not(.page-insights) .nb-practice-jump {
    flex-wrap: nowrap; overflow-x: auto; margin: 2px -14px 14px; padding: 0 14px 4px; scrollbar-width: none;
  }
  html body.page-practice:not(.page-insights) .nb-practice-jump::-webkit-scrollbar { display: none; }
  html body.page-practice:not(.page-insights) .nb-practice-jump a { font-size: 11px; padding: 5px 9px; }
}
@media (min-width: 768px) {
  html body.page-practice:not(.page-insights) .nb-practice-jump { gap: 6px; }
  html body.page-practice:not(.page-insights) .nb-practice-jump a { font-size: 11.5px; padding: 5px 9px; gap: 6px; }
}
html body.page-practice:not(.page-insights) #practice-content-title { scroll-margin-top: 90px; }
@media (min-width: 768px) and (max-width: 1365px) {
  html body.page-practice:not(.page-insights) .nb-practice-jump { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  html body.page-practice:not(.page-insights) .nb-practice-jump a { justify-content: flex-start; overflow: hidden; text-overflow: ellipsis; }
}

/* =====================================================================
   6. ONE DESIGN ON EVERY DEVICE
   Phones used to get a separate "mobile site" (flat heroes without photos, a
   different footer, very small type). These rules bring phones back to the
   desktop design: same hero photos, same footer, same proportions — fitted to
   a narrow screen. Boosted with :not(#nbu) to outrank the older mobile rules.
   ===================================================================== */
@media (max-width: 767px) {
  /* ---- Heroes: the desktop photo, with an even overlay so text stays readable ---- */
  html body:not(#nbu) main > section:is(.nb-hero, .about-page-hero, .hero) {
    display: flex !important; align-items: center !important;
    height: auto !important; min-height: 440px !important; max-height: none !important;
    padding: 46px 0 42px !important; background-color: #1f0b04 !important;
    background-repeat: no-repeat !important; background-size: cover, cover !important;
  }
  html body:not(#nbu) main > section:is(.nb-hero, .about-page-hero, .hero)::before,
  html body:not(#nbu) main > section:is(.nb-hero, .about-page-hero, .hero)::after { background: none !important; }
  html body:not(#nbu) main > section.nb-hero {
    background-image: linear-gradient(180deg, rgba(24,9,3,.66), rgba(24,9,3,.78)), url('../images/homepage-hero-user.webp') !important;
    background-position: center, 72% center !important;
  }
  html body:not(#nbu) main > section.about-page-hero {
    background-image: linear-gradient(180deg, rgba(24,9,3,.66), rgba(24,9,3,.78)), url('../images/about-hero-v010.webp') !important;
    background-position: center, 78% center !important;
  }
  html body:not(#nbu) main > section.practice-hero:not(.insights-hero) {
    background-image: linear-gradient(180deg, rgba(24,9,3,.68), rgba(24,9,3,.80)), url('../images/practice-hero-v043.webp') !important;
    background-position: center, 70% center !important;
  }
  html body:not(#nbu) main > section.partners-hero {
    background-image: linear-gradient(180deg, rgba(24,9,3,.68), rgba(24,9,3,.80)), url('../images/partners-hero-user.webp') !important;
    background-position: center, 68% center !important;
  }
  html body:not(#nbu) main > section.contact-hero {
    background-image: linear-gradient(180deg, rgba(24,9,3,.66), rgba(24,9,3,.80)), url('../images/contact-hero-custom.webp') !important;
    background-position: center, 66% center !important;
  }
  html body:not(#nbu) main > section.insights-hero {
    background-image: linear-gradient(180deg, rgba(24,9,3,.62), rgba(24,9,3,.80)), url('../images/insights-hero.webp') !important;
    background-position: center, 78% center !important;
  }

  /* ---- Hero text and buttons: desktop proportions ---- */
  html body:not(#nbu) main > section:first-child :is(.eyebrow, .nb-kicker, .about-preheading, [class*="kicker"]) {
    font-size: 11px !important; letter-spacing: .16em !important; line-height: 1.3 !important;
  }
  html body:not(#nbu) main > section:first-child h1,
  html body:not(#nbu) main > section:first-child h1 span {
    font-size: 30px !important; line-height: 1.16 !important; font-weight: 400 !important; letter-spacing: -.01em !important;
  }
  html body:not(#nbu) main > section:first-child p:not(.eyebrow):not(.nb-kicker):not(.about-preheading):not([class*="kicker"]):not(.nb-specialties) {
    font-size: 14px !important; line-height: 1.55 !important; font-weight: 400 !important;
  }
  html body:not(#nbu) main > section:first-child :is(.nb-specialties, .nb-practice-specialties) { font-size: 10.5px !important; letter-spacing: .1em !important; }
  html body:not(#nbu) main > section:first-child br.desktop-break { display: none !important; }
  html body:not(#nbu) .nb-v043-hero-buttons { display: flex !important; flex-wrap: wrap !important; gap: 10px !important; }
  html body:not(#nbu) a.nb-v043-hero-btn,
  html body:not(#nbu) main a:is(.nb-about-button, .nb-correspondence-btn, .nb-industries-button, .nb-story-primary, .nb-story-secondary, .nb-about-btn, .nb-learn-more) {
    height: auto !important; min-height: 42px !important; max-height: none !important; padding: 10px 16px !important;
    font-size: 13.5px !important; line-height: 1.2 !important; gap: 10px !important; border-radius: 5px !important;
  }
  html body:not(#nbu) a.nb-v043-hero-btn span,
  html body:not(#nbu) main a:is(.nb-about-button, .nb-correspondence-btn, .nb-industries-button, .nb-story-primary, .nb-story-secondary) span { font-size: 15px !important; }

  /* ---- Section headings, kickers and text ---- */
  html body:not(#nbu) main > section:not(:first-child) h2,
  html body:not(#nbu) main > section:not(:first-child) h2 *,
  html body:not(#nbu) main > div h2, html body:not(#nbu) main > div h2 * {
    font-size: 27px !important; line-height: 1.18 !important; font-weight: 400 !important; letter-spacing: -.005em !important;
  }
  html body:not(#nbu) main > :not(section:first-child) :is(.nb-eyebrow, .nb-practice-kicker, .nb-partners-kicker, .nb-contact-kicker, .nb-correspondence-eyebrow, [class*="kicker"], [class*="eyebrow"]) {
    font-size: 11px !important; letter-spacing: .18em !important; line-height: 1.3 !important;
  }
  html body:not(#nbu) main > :not(section:first-child) p:not([class*="kicker"]):not([class*="eyebrow"]) { font-size: 14px !important; line-height: 1.6 !important; }
  /* compact card text keeps the desktop card scale */
  html body:not(#nbu) main :is(.nb-practice-tile-body > p, .nb-expertise-card p, .nb-partner-bio p:not([class])) { font-size: 13px !important; line-height: 1.55 !important; }
  html body:not(#nbu) main :is(.nb-practice-tile h3, .nb-expertise-card h3) { font-size: 17px !important; line-height: 1.25 !important; font-weight: 400 !important; }
  html body:not(#nbu) main .nb-partner-bio h3 { font-size: 22px !important; line-height: 1.2 !important; }
  html body:not(#nbu) main .nb-partner-role { font-size: 16px !important; }
  html body:not(#nbu) main .nb-partner-education { font-size: 12.5px !important; }
  html body:not(#nbu) main .nb-practice-tags button { font-size: 12px !important; }
  html body:not(#nbu) main .nb-practice-details summary { font-size: 11px !important; letter-spacing: .08em !important; }
  html body:not(#nbu) main .nb-practice-details summary .nb-practice-plus { font-size: 16px !important; }
  html body:not(#nbu) main .nb-cta-correspondence h2,
  html body:not(#nbu) main .nb-cta-correspondence h2 *,
  html body:not(#nbu) #nb-correspondence-heading, html body:not(#nbu) #nb-correspondence-heading span { font-size: 22px !important; line-height: 1.25 !important; }

  /* ---- Footer: the desktop footer, stacked for a narrow screen ---- */
  html body:not(#nbu) .mobile-footer-v189 { display: none !important; }
  html body:not(#nbu) footer.nb-footer { display: block !important; padding: 26px 0 8px !important; }
  html body:not(#nbu) footer.nb-footer .nb-shell { width: auto !important; max-width: none !important; margin: 0 20px !important; padding: 0 !important; }
  html body:not(#nbu) footer.nb-footer .nb-footer-grid {
    display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 20px 18px !important; text-align: left !important;
  }
  html body:not(#nbu) footer.nb-footer .nb-footer-grid > * {
    width: auto !important; min-width: 0 !important; border: 0 !important; padding: 0 !important; margin: 0 !important; max-width: none !important;
  }
  html body:not(#nbu) footer.nb-footer .nb-footer-grid > .nb-footer-logo { grid-column: 1 / -1 !important; justify-content: flex-start !important; }
  html body:not(#nbu) footer.nb-footer .nb-footer-grid > :nth-child(2) { grid-column: 1 / -1 !important; }
  html body:not(#nbu) footer.nb-footer .nb-footer-grid > .nb-footer-links { grid-column: 1 / -1 !important; }
  html body:not(#nbu) footer.nb-footer .nb-footer-links nav { display: flex !important; flex-wrap: wrap !important; gap: 6px 16px !important; }
  html body:not(#nbu) footer.nb-footer :is(address, a, span, small) { font-size: 13px !important; line-height: 1.55 !important; }
  html body:not(#nbu) footer.nb-footer .nb-footer-heading, html body:not(#nbu) footer.nb-footer .nb-footer-heading span { font-size: 13.5px !important; }
  html body:not(#nbu) footer.nb-footer .nb-footer-bottom { margin-top: 22px !important; padding: 14px 0 10px !important; text-align: center !important; }
  html body:not(#nbu) footer.nb-footer .nb-footer-legal-links { display: flex !important; flex-wrap: wrap !important; justify-content: center !important; gap: 6px 10px !important; }
  html body:not(#nbu) footer.nb-footer .nb-footer-legal-links :is(a, span, button) { font-size: 12px !important; }
  html body:not(#nbu) footer.nb-footer .nb-footer-copyright { font-size: 11.5px !important; }
}

/* ---- 6b. Refinements (stronger selectors where older mobile rules were more specific) ---- */
@media (max-width: 767px) {
  /* section headings: desktop style (light weight) on pages with a hero; legal pages keep their bold sub-headings */
  html body:not(#nbu):not(#nbv) main:has(> section:is(.nb-hero, .about-page-hero, .hero)) > :not(section:first-child) h2,
  html body:not(#nbu):not(#nbv) main:has(> section:is(.nb-hero, .about-page-hero, .hero)) > :not(section:first-child) h2 * {
    font-size: 27px !important; line-height: 1.18 !important; font-weight: 400 !important; letter-spacing: -.005em !important;
  }
  html body:not(#nbu):not(#nbv) main:not(:has(> section:is(.nb-hero, .about-page-hero, .hero))) h2 { font-size: 21px !important; line-height: 1.25 !important; font-weight: 700 !important; }
  html body:not(#nbu):not(#nbv) main:not(:has(> section:is(.nb-hero, .about-page-hero, .hero))) h1 { font-size: 32px !important; line-height: 1.15 !important; font-weight: 400 !important; }
  html body:not(#nbu):not(#nbv) main .nb-ga-policy-update h2 { font-size: 21px !important; font-weight: 700 !important; }
  html body:not(#nbu):not(#nbv) main .nb-cta-correspondence h2,
  html body:not(#nbu):not(#nbv) main .nb-cta-correspondence h2 * { font-size: 22px !important; font-weight: 400 !important; line-height: 1.25 !important; }

  /* body text inside content sections */
  html body:not(#nbu):not(#nbv) main > :not(section:first-child) p:not([class*="kicker"]):not([class*="eyebrow"]):not(.nb-insight-note) { font-size: 14px !important; line-height: 1.6 !important; }
  html body:not(#nbu):not(#nbv) main :is(.nb-practice-tile-body > p, .nb-expertise-card p, .nb-partner-bio p:not([class])) { font-size: 13px !important; line-height: 1.55 !important; }

  /* practice / insights cards: tags, summary row, approach cards */
  html body:not(#nbu):not(#nbv) main .nb-practice-tile .nb-practice-tags button { font-size: 12px !important; line-height: 1.3 !important; padding: 6px 9px !important; }
  html body:not(#nbu):not(#nbv) main .nb-practice-tile .nb-practice-details summary { font-size: 11px !important; letter-spacing: .08em !important; }
  html body:not(#nbu):not(#nbv) main .nb-practice-tile .nb-practice-plus { width: 34px !important; height: 34px !important; font-size: 16px !important; }
  html body:not(#nbu):not(#nbv) main .nb-practice-tile .nb-expanded-content :is(p, h4) { font-size: 14px !important; line-height: 1.55 !important; }
  html body:not(#nbu):not(#nbv) main .nb-practice-tile .nb-expanded-content h4 { font-size: 15.5px !important; }
  html body:not(#nbu):not(#nbv) main .nb-practice-tile .nb-expanded-content > div > a,
  html body:not(#nbu):not(#nbv) main .nb-practice-tile .nb-expanded-content a { font-size: 13px !important; }
  html body:not(#nbu):not(#nbv) main [class*="approach"] :is(h3, h4) { font-size: 16px !important; line-height: 1.3 !important; }
  html body:not(#nbu):not(#nbv) main [class*="approach"] p { font-size: 13.5px !important; line-height: 1.55 !important; }
  html body:not(#nbu):not(#nbv) main .nb-insight-meta :is(.nb-insight-tag, time) { font-size: 12px !important; }

  /* contact page details */
  html body:not(#nbu):not(#nbv) main .nb-contact-item h3 { font-size: 18px !important; }
  html body:not(#nbu):not(#nbv) main .nb-contact-item :is(address, a) { font-size: 14px !important; line-height: 1.55 !important; font-style: normal !important; }
  html body:not(#nbu):not(#nbv) main .nb-contact-assurance span { font-size: 12.5px !important; line-height: 1.35 !important; }
  html body:not(#nbu):not(#nbv) main .contact-hero-highlight { font-size: 14px !important; }
  html body:not(#nbu):not(#nbv) main .nb-contact-intro { font-size: 14px !important; }

  /* footer: horizontal logo like desktop, links wrap */
  html body:not(#nbu):not(#nbv) footer.nb-footer .nb-footer-logo { display: flex !important; align-items: center !important; gap: 10px !important; }
  html body:not(#nbu):not(#nbv) footer.nb-footer .nb-footer-logo img { width: 52px !important; height: auto !important; margin: 0 !important; }
  html body:not(#nbu):not(#nbv) footer.nb-footer .nb-footer-logo .nb-new-wordmark { display: flex !important; flex-direction: column !important; align-items: flex-start !important; }
  html body:not(#nbu):not(#nbv) footer.nb-footer .nb-footer-logo .nb-new-wordmark > span { font-size: 19px !important; letter-spacing: .12em !important; }
  html body:not(#nbu):not(#nbv) footer.nb-footer .nb-footer-logo .nb-new-wordmark small { font-size: 10px !important; letter-spacing: .3em !important; }
  html body:not(#nbu):not(#nbv) footer.nb-footer .nb-footer-links nav { display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; gap: 6px 16px !important; }
  html body:not(#nbu):not(#nbv) footer.nb-footer .nb-footer-links nav a { display: inline-block !important; width: auto !important; margin: 0 !important; }
}
