/* Front-end stylesheet entry point. Keep imports ordered from shared to page-specific styles. */
@import url('./stylehome-base.css');
@import url('./stylehome-frame.css');
@import url('./stylehome.css');
@import url('./blogstyle.css');
@import url('./contactstyle.css');

/* Keep both the utility bar and primary navigation visible while scrolling. */
.home-header {
  position: sticky;
  z-index: 1000;
  top: 0;
}

@media (max-width: 1100px) {
  .home-header__utility .home-header__contact:first-child {
    display: flex;
  }
}

.site-breadcrumbs { max-width: 1540px; margin: 0 auto; padding: 12px 24px; font-size: 13px; }
.site-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.site-breadcrumbs li:not(:last-child)::after { margin-left: 8px; content: '/'; color: #888; }
.site-breadcrumbs a { color: var(--stamp); text-decoration: none; }

.home-header__mega-column--services > .home-header__applications-list {
  position: static;
  display: block;
  min-width: 300px;
  margin: 0;
  padding: 0;
  box-shadow: none;
  list-style: none;
}

.home-header__mega-column--services > .home-header__applications-list > li > .dropdown-item {
  display: flex;
  padding: 10px 0;
  justify-content: space-between;
  color: inherit;
  text-decoration: none;
}

/* A group without children is a destination link, not a flyout trigger. */
.home-header__mega-leaf {
  display: block;
  margin: -6px 0 4px;
  padding: 8px 0;
  color: #000;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
}

.home-header__mega-leaf:hover,
.home-header__mega-leaf:focus-visible {
  color: var(--stamp);
}

/* Desktop flyouts consume the next column; do not leave faded columns underneath them. */
@media (min-width: 1101px) {
  .home-header__mega-inner:has(.home-header__mega-subgroup:hover, .home-header__mega-subgroup.is-open),
  .home-header__mega-inner:has(.home-header__applications-group:hover, .home-header__applications-group.is-open),
  .home-header__mega-inner:has(.home-header__challenge-group:hover, .home-header__challenge-group.is-hover-open, .home-header__challenge-group.is-open) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 42px;
  }

  .home-header__mega-inner > .home-header__mega-column--services { grid-column: 1 !important; }
  .home-header__mega-inner > .home-header__mega-column--family { grid-column: 2 !important; }
  .home-header__mega-inner > .home-header__mega-column--settlement { grid-column: 3 !important; }

  .home-header__mega-inner:has(.home-header__mega-subgroup:hover, .home-header__mega-subgroup.is-open) > :is(.home-header__mega-column--family, .home-header__mega-column--settlement, .home-header__mega-feature) {
    display: none !important;
  }

  .home-header__mega-inner:has(.home-header__applications-group:hover, .home-header__applications-group.is-open) > :is(.home-header__mega-column--settlement, .home-header__mega-feature) {
    display: none !important;
  }

  .home-header__mega-inner:has(.home-header__challenge-group:hover, .home-header__challenge-group.is-hover-open, .home-header__challenge-group.is-open) > .home-header__mega-feature {
    display: none !important;
  }

  .home-header__mega-inner > :is(.home-header__mega-column, .home-header__mega-feature) {
    opacity: 1;
  }
}

/* Nested mega-menu panels mirror their parent panel: title first, then link rows. */
.home-header__nested-panel {
  grid-auto-flow: row;
  grid-template-rows: auto 1fr;
  align-content: start;
}

@media (min-width: 981px) {
  .home-header__applications-flyout.home-header__nested-panel {
    left: 100%;
  }

  .dropdown-submenu:has(> .home-header__applications-flyout.home-header__nested-panel)::after {
    position: absolute;
    top: 0;
    left: 100%;
    width: 16px;
    height: 100%;
    content: '';
  }
}

.home-header__nested-panel-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-header__nested-panel-links > li {
  position: static;
  margin: 0;
  padding: 0;
}

.home-header__nav-item--dropdown {
  position: relative;
  align-self: stretch;
}

.home-header__nav-item--dropdown > .home-header__link {
  height: 100%;
}

.home-header__simple-dropdown {
  position: absolute;
  z-index: 35;
  top: 100%;
  left: 0;
  display: none;
  width: 240px;
  margin: 0;
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--rule);
  box-shadow: 0 12px 24px rgb(18 32 58 / 12%);
  list-style: none;
}

.home-header__nav-item--dropdown:hover > .home-header__simple-dropdown,
.home-header__nav-item--dropdown.is-open > .home-header__simple-dropdown {
  display: block;
}

.home-header__simple-dropdown a {
  display: block;
  padding: 10px 12px;
  color: #000;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
}

.home-header__simple-dropdown a:hover,
.home-header__simple-dropdown a:focus-visible {
  color: var(--stamp);
  background: var(--paper);
}

@media (max-width: 1100px) {
  .home-header__nav-item--dropdown {
    align-self: auto;
  }

  .home-header__nav-item--dropdown > .home-header__link {
    width: 100%;
    height: auto;
    border-bottom: 1px solid var(--rule);
  }

  .home-header__simple-dropdown {
    position: static;
    width: 100%;
    padding: 6px 12px;
    border: 0;
    border-left: 2px solid var(--stamp);
    box-shadow: none;
  }
}

/* All desktop mega menus share the same measured grid and vertical rhythm. */
@media (min-width: 1101px) {
  .home-header__mega {
    padding: 38px 0 36px;
  }

  .home-header__mega-inner {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(260px, .86fr);
    align-items: start;
    column-gap: 42px;
    row-gap: 0;
  }

  .home-header__mega-column {
    min-width: 0;
    align-self: start;
  }

  .home-header__mega-column h2 {
    display: flex;
    min-height: 30px;
    margin: 0 0 18px;
    padding: 0 0 11px;
    align-items: flex-start;
  }

  .home-header__mega-column > :is(a, .home-header__mega-leaf, div) {
    margin-top: 0;
  }

  .home-header__mega-leaf,
  .home-header__mega-subgroup > button,
  .home-header__applications-group > button,
  .home-header__challenge-group > button {
    min-height: 36px;
    margin-bottom: 1px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .home-header__mega-leaf {
    display: flex;
    width: 100%;
    margin-right: 0;
    margin-left: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
  }

  .home-header__mega-subgroup > button,
  .home-header__applications-group > button,
  .home-header__challenge-group > button {
    align-items: center;
    text-align: left;
  }

  .home-header__mega--simple {
    height: auto;
    min-height: 0 !important;
    overflow: visible;
  }

  .home-header__mega--simple .home-header__mega-inner {
    height: auto;
    min-height: 0;
  }

  .home-header__mega--simple .home-header__mega-column {
    padding-bottom: 4px;
  }

  .home-header__mega-feature {
    width: 100%;
    min-width: 0;
    margin: 0;
  }

  .home-header__simple-dropdown {
    right: 0;
    left: auto;
    width: 255px;
    padding: 8px;
    border-top: 2px solid var(--stamp);
    border-radius: 0 0 8px 8px;
    animation: header-menu-enter .2s cubic-bezier(.22, 1, .36, 1) both;
  }

  .home-header__simple-dropdown a {
    padding: 11px 13px;
    border-radius: 5px;
  }

  .home-header__simple-dropdown li + li {
    border-top: 1px solid rgb(18 32 58 / 7%);
  }
}

/* Final typography system: editorial serif headings with a calm, highly legible UI sans. */
:root {
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --type-xs: 12px;
  --type-sm: 14px;
  --type-body: 16px;
  --type-lead: 18px;
}

html {
  font-family: var(--body);
  font-size: 16px;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body,
button,
input,
select,
textarea {
  font-family: var(--body);
}

body {
  font-size: var(--type-body);
  font-weight: 400;
  line-height: 1.65;
}

:where(h1, h2, h3, h4) {
  text-wrap: balance;
}

:where(p, li) {
  text-wrap: pretty;
}

.home-header__link {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -.01em;
}

.home-header__cta {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.home-header__contact {
  font-size: 11px;
  line-height: 1.3;
}

.home-header__contact strong {
  font-size: 11px;
  font-weight: 600;
}

.home-header__mega-column h2,
.home-header__mega-submenu h3,
.home-header__applications-panel h3,
.home-header__challenge-panel h3 {
  font-family: var(--body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
}

.home-header__mega-column a,
.home-header__mega-column button,
.home-header__mega-leaf {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

:is(
  .dlc-consultation-hero,
  .dlc-services-showcase,
  .dlc-application-directory,
  .dlc-case-stories,
  .dlc-blog-journal,
  .dlc-solicitor-office,
  .dlc-trust-reasons,
  .dlc-faq-contact,
  .dlc-after-form,
  .dlc-contact-page,
  .dlc-blog-page,
  .builder-page
) :is(h1, h2, h3, h4) {
  font-family: var(--display);
  font-optical-sizing: auto;
  letter-spacing: -.018em;
}

:is(
  .dlc-services-showcase__eyebrow,
  .dlc-application-directory__eyebrow,
  .dlc-case-stories__eyebrow,
  .dlc-blog-journal__eyebrow,
  .dlc-solicitor-office__eyebrow,
  .dlc-trust-reasons__eyebrow,
  .dlc-faq-contact__eyebrow,
  .dlc-blog-page__eyebrow,
  .dlc-contact-eyebrow,
  .builder-page-eyebrow
) {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .16em;
}

:is(
  .dlc-consultation-hero__summary,
  .dlc-services-showcase__intro,
  .dlc-case-stories__intro,
  .dlc-solicitor-office__bio > p,
  .dlc-trust-reasons__lead
) {
  font-size: clamp(17px, 1.25vw, 18px);
  font-weight: 400;
  line-height: 1.72;
}

.page-builder-content,
.dlc-blog-single__body {
  font-size: clamp(16px, 1.1vw, 17px);
  font-weight: 400;
  line-height: 1.75;
}

.page-builder-content :is(h2, h3, h4),
.dlc-blog-single__body :is(h2, h3, h4) {
  font-weight: 600;
  line-height: 1.2;
}

:is(
  .dlc-case-story h3,
  .dlc-blog-card h3,
  .dlc-trust-reasons__point h3,
  .dlc-faq-contact__item summary
) {
  font-weight: 500;
}

:is(
  .home-header__cta,
  .dlc-consultation-hero__button,
  .dlc-case-stories__button,
  .dlc-blog-journal__button,
  .dlc-solicitor-office__button,
  .dlc-faq-contact__button,
  .dlc-after-form__contact-button
) {
  font-weight: 600;
  letter-spacing: -.01em;
}

.site-breadcrumbs,
.builder-page-breadcrumbs,
.builder-page-byline,
.dlc-blog-single__meta {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.footer-grid h3 {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
}

.footer-company > p,
.footer-address > p,
.footer-links li,
.footer-hours li {
  font-size: 14px;
  line-height: 1.65;
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .home-header__link { font-size: 15px; }
  .page-builder-content,
  .dlc-blog-single__body { font-size: 16px; line-height: 1.7; }
}

.seo-internal-link {
  color: var(--stamp);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Sticky needs the viewport—not an overflow-created html box—as its scroll container. */
html {
  overflow-x: clip;
  overflow-y: visible;
}

body {
  overflow: visible;
}

.home-header {
  position: -webkit-sticky !important;
  position: sticky !important;
  z-index: 1000;
  top: 0;
  isolation: isolate;
  box-shadow: 0 0 0 rgb(18 32 58 / 0%);
  transition: box-shadow .28s ease;
}

/* Header finish: restrained movement, clearer interaction and depth on scroll. */
.home-header::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgb(194 60 38 / 32%) 50%, transparent);
  opacity: 0;
  transition: opacity .28s ease;
}

.home-header__top {
  background: linear-gradient(105deg, #101f39 0%, #142846 55%, #101f39 100%);
}

.home-header__main {
  background-color: rgb(247 244 236 / 98%);
  transition: background-color .28s ease, border-color .28s ease;
}

.home-header.is-scrolled {
  box-shadow: 0 10px 30px rgb(18 32 58 / 14%);
}

.home-header.is-scrolled::after {
  opacity: 1;
}

.home-header.is-scrolled .home-header__main {
  border-bottom-color: transparent;
  background-color: rgb(247 244 236 / 96%);
  -webkit-backdrop-filter: saturate(115%) blur(10px);
  backdrop-filter: saturate(115%) blur(10px);
}

.home-header__logo img {
  transition: transform .28s ease, filter .28s ease;
}

.home-header__logo:hover img,
.home-header__logo:focus-visible img {
  filter: saturate(1.08);
  transform: translateY(-1px);
}

.home-header__link {
  transition: color .2s ease;
}

.home-header__link::before {
  bottom: 3px;
  border-radius: 999px;
  transition: transform .24s cubic-bezier(.22, 1, .36, 1);
}

.home-header__link:hover,
.home-header__link:focus-visible {
  color: var(--stamp);
}

.home-header__link:focus-visible,
.home-header__cta:focus-visible,
.home-header__logo:focus-visible,
.home-header__contact:focus-visible,
.home-header__toggle:focus-visible {
  outline: 2px solid var(--stamp);
  outline-offset: 4px;
}

.home-header__contact {
  transition: opacity .2s ease, transform .2s ease;
}

.home-header__contact:hover,
.home-header__contact:focus-visible {
  opacity: .95;
  transform: translateY(-1px);
}

.home-header__cta {
  border: 1px solid rgb(117 32 22 / 18%);
  box-shadow: 0 7px 16px rgb(194 60 38 / 18%);
  transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.home-header__cta:hover,
.home-header__cta:focus-visible {
  box-shadow: 0 10px 22px rgb(194 60 38 / 26%);
  transform: translateY(-2px);
}

.home-header__cta:active {
  box-shadow: 0 4px 10px rgb(194 60 38 / 18%);
  transform: translateY(0);
}

.home-header__link--drop::after,
.home-header__toggle span {
  transition: transform .2s ease, color .2s ease, width .2s ease;
}

.home-header__mega {
  transform-origin: top center;
}

.home-header__nav-item--mega:hover .home-header__mega,
.home-header__nav-item--mega.is-hover-open .home-header__mega,
.home-header__nav-item--mega.is-open .home-header__mega {
  animation: header-menu-enter .2s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes header-menu-enter {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 991px) {
  .home-header__nav-item--mega:hover .home-header__mega,
  .home-header__nav-item--mega.is-hover-open .home-header__mega,
  .home-header__nav-item--mega.is-open .home-header__mega {
    animation: none;
  }

  .home-header__toggle:hover span:nth-of-type(2) {
    width: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-header,
  .home-header *,
  .home-header *::before,
  .home-header *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Terminal mega-menu destinations: match trigger rows without implying a flyout. */
@media (min-width: 1101px) {
  .home-header__mega-column > a.home-header__mega-leaf {
    display: flex;
    width: calc(100% + 20px);
    min-height: 36px;
    margin: -1px -10px 1px;
    padding: 8px 10px;
    box-sizing: border-box;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    color: #000;
    background: transparent;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
    text-align: left;
    text-decoration: none;
    white-space: normal;
    transition: color .18s ease, background-color .18s ease;
  }

  .home-header__mega-column > a.home-header__mega-leaf:hover,
  .home-header__mega-column > a.home-header__mega-leaf:focus-visible {
    color: var(--stamp);
    background: var(--paper);
  }
}

@media (max-width: 1100px) {
  .home-header__mega-column > a.home-header__mega-leaf {
    display: flex;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 11px 14px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    color: #000;
    background: var(--white);
    border-bottom: 1px solid var(--rule);
    text-align: left;
  }

  .home-header__mega-column > a.home-header__mega-leaf:hover,
  .home-header__mega-column > a.home-header__mega-leaf:focus-visible {
    color: var(--stamp);
    background: var(--paper);
  }
}
