/* Shared interaction language; page content is visible without JavaScript. */
body.digby-site {
  --digby-ease: cubic-bezier(.22, 1, .36, 1);
  --digby-nav-height: 90px;
  --digby-admin-offset: 0px;
  --digby-header-overlap: 0px;
}
body.digby-site.admin-bar { --digby-admin-offset: 32px; }

/* Overlay only an actual first-section image. Plain pages retain a solid header. */
body.digby-site:has(#main-content > :is(.hero, .image-masthead):first-child):not(:has(> .dgp-preview-banner)) {
  --digby-header-overlap: var(--digby-nav-height);
}
body.digby-site:has(#main-content > :is(.hero, .image-masthead):first-child):not(:has(> .dgp-preview-banner)) .site-header {
  position: absolute;
  inset: var(--digby-admin-offset) 0 auto;
  height: var(--digby-nav-height);
  z-index: 30;
  background: rgba(9, 27, 46, .32);
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .24);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body.digby-site .site-header { transition: background-color 220ms ease; }
body.digby-home .hero-inner { padding-top: calc(80px + var(--digby-header-overlap)); }
body.digby-home .hero-shade {
  background:
    linear-gradient(180deg, rgba(7, 20, 36, .48), transparent 160px),
    linear-gradient(90deg, rgba(7, 16, 30, .92), rgba(18, 37, 65, .75) 39%, rgba(18, 37, 65, .18) 73%, rgba(7, 16, 30, .24)),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, .38));
}
body.digby-site .image-masthead {
  padding-top: calc(64px + var(--digby-header-overlap));
  isolation: isolate;
}
body.digby-site .image-masthead::before { inset: 0; }
body.digby-site .detail-masthead { padding-top: calc(36px + var(--digby-header-overlap)); }

/* Links respond without shifting their text or changing the layout. */
/* Keep cursor feedback across the entire link box, including nested card content. */
body.digby-site a[href],
body.digby-site a[href] * {
  cursor: pointer;
}
body.digby-site .site-header nav a::after {
  right: 0;
  bottom: 3px;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 260ms var(--digby-ease);
}
body.digby-site .site-header nav a:is(:hover, :focus-visible, [aria-current])::after { transform: scaleX(1); }
body.digby-site .site-header nav a { text-shadow: 0 1px 12px rgba(5, 16, 29, .25); }
body.digby-site :is(.site-footer, .team-contact, .dgp-staff-facts, .digby-article-body) a:not(.footer-logo) {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: color 180ms ease, text-decoration-color 220ms ease;
}
body.digby-site :is(.site-footer, .team-contact, .dgp-staff-facts, .digby-article-body) a:not(.footer-logo):is(:hover, :focus-visible) {
  color: var(--digby-text-link, #304572);
  text-decoration-color: currentColor;
}
body.digby-site .digby-article-body .prose a { text-decoration-color: currentColor; }
body.digby-site :is(.text-link, .dgp-back, .dgp-download) {
  transition: color 180ms ease, border-color 220ms ease;
}
body.digby-site :is(.text-link, .dgp-back, .dgp-download):is(:hover, :focus-visible) {
  color: var(--digby-text-link, #304572);
  border-color: #304572;
}
body.digby-site .theme-dark .text-link:is(:hover, :focus-visible) { color: var(--digby-text-inverse, #fff); border-color: #fff; }

/* Buttons: color response, a small lift, and a directional arrow. */
body.digby-site :is(.button, .dgp-button, .dgp-filter-actions button) {
  transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease,
    box-shadow 260ms var(--digby-ease), transform 260ms var(--digby-ease);
}
body.digby-site :is(.button, .dgp-button, .dgp-filter-actions button):is(:hover, :focus-visible) {
  background-color: #152744;
  border-color: #152744;
  color: var(--digby-text-inverse, #fff);
}
body.digby-site :is(.hero, .image-masthead, .theme-dark, .confidential) .button:is(:hover, :focus-visible) {
  background-color: #e6edf6;
  border-color: #e6edf6;
  color: #152744;
}
body.digby-site .digby-signup .newsletter .button:is(:hover, :focus-visible) {
  background-color: #435d91;
  border-color: #9eafcb;
  color: var(--digby-text-inverse, #fff);
}
body.digby-site :is(.button, .text-link) [data-digby-field] { transform: none !important; }
body.digby-site :is(.button, .text-link) b,
body.digby-site .dgp-card-action span {
  display: inline-block;
  transition: transform 260ms var(--digby-ease);
}
body.digby-site :is(.button, .text-link):is(:hover, :focus-visible) b { transform: translateX(4px); }
body.digby-site .dgp-card:focus-within .dgp-card-action span { transform: translateX(4px); }
body.digby-site :is(.button, .dgp-button, .dgp-filter-actions button):active { transform: translateY(0); box-shadow: none; }
/* Replace the comp's universal six-pixel focus shadow with a precise ring. */
body.digby-site :focus-visible {
  outline: 2px solid #304572 !important;
  outline-offset: 4px;
  box-shadow: none !important;
}
body.digby-site #main-content:focus { outline: none !important; }
body.digby-site :is(.hero, .image-masthead, .theme-dark, .site-header) :is(a, button):focus-visible {
  outline: 2px solid #fff !important;
  outline-offset: 5px;
}

/* Image and card affordances work from both the picture and the text link. */
body.digby-site :is(.dgp-card-photo, .portrait, .insight-picture) { overflow: hidden; }
body.digby-site :is(.dgp-card-photo, .portrait, .insight-picture) img {
  transition: transform 650ms var(--digby-ease), filter 450ms ease;
}
body.digby-site :is(.dgp-card, .team-card, .insight-card) h3 a {
  transition: color 180ms ease;
}
body.digby-site :is(.team-card, .insight-card):focus-within h3 a { color: var(--digby-text-link, #304572); }
body.digby-site :is(.team-card, .insight-card):focus-within img { transform: scale(1.025); }
body.digby-site .dgp-thumbnails button { transition: opacity 200ms ease, outline-color 200ms ease; }
body.digby-site .dgp-thumbnails button:is(:hover, :focus-visible) { opacity: 1; }

/* Focus and selection feedback for the real property and contact controls. */
body.digby-site :is(input, select, textarea) {
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}
body.digby-site :is(.contact-form, .newsletter, .dgp-query, .dgp-range-numbers, .transaction-controls) :is(input:not([type="checkbox"]), select, textarea):focus {
  border-color: #304572 !important;
  box-shadow: 0 0 0 3px rgba(48, 69, 114, .13) !important;
  background-color: #fff;
}
body.digby-site .contact-form label { transition: color 180ms ease; }
body.digby-site .contact-form label:focus-within { color: var(--digby-text-link, #304572); }
body.digby-site :is(.dgp-type-options, .dgp-segments) span,
body.digby-site :is(.digby-market-buttons button, .dgp-results-toolbar button, .dgp-mobile-toggle) {
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}
body.digby-site :is(.digby-market-buttons button, .dgp-results-toolbar button, .dgp-mobile-toggle):is(:hover, :focus-visible) {
  background-color: #e6ebf2;
  border-color: #304572;
  color: #152744;
}
body.digby-site .digby-market-buttons button[aria-pressed="true"] { background: #304572; color: var(--digby-text-inverse, #fff); }
body.digby-site .dgp-results { transition: opacity 180ms ease; }
body.digby-site .dgp-search[aria-busy="true"] .dgp-results { cursor: progress; }

@keyframes digby-introduce {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  body.digby-home .hero-copy { animation: none; }
  body.digby-home .hero-copy > * { animation: digby-introduce 700ms var(--digby-ease) both; }
  body.digby-home .hero-copy > :nth-child(2) { animation-delay: 70ms; }
  body.digby-home .hero-copy > :nth-child(3) { animation-delay: 140ms; }
  body.digby-home .hero-copy > :nth-child(4) { animation-delay: 210ms; }
  body.digby-site .image-masthead .intro { animation: digby-introduce 650ms var(--digby-ease) both; }
}
@media (hover: hover) and (pointer: fine) {
  body.digby-site :is(.button, .dgp-button, .dgp-filter-actions button):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(12, 28, 49, .12);
  }
  body.digby-site :is(.button, .dgp-button, .dgp-filter-actions button):active { transform: none; }
  body.digby-site :is(.dgp-card, .team-card, .insight-card):hover img { transform: scale(1.035); }
  body.digby-site :is(.team-card, .insight-card):hover h3 a { color: var(--digby-text-link, #304572); }
  body.digby-site .dgp-card:hover .dgp-card-action span { transform: translateX(4px); }
  body.digby-site :is(.dgp-segments, .dgp-type-options) label:hover span { border-color: #304572; }
}
@media (max-width: 800px) {
  body.digby-site { --digby-nav-height: 74px; }
  body.digby-home .hero-inner { padding-top: calc(56px + var(--digby-header-overlap)); }
  body.digby-site .image-masthead { padding-top: calc(42px + var(--digby-header-overlap)); }
  body.digby-site .detail-masthead { padding-top: calc(30px + var(--digby-header-overlap)); }
  body.digby-site .site-header.is-menu-open { background-color: #102339 !important; }
  body.digby-site .menu-toggle {
    border-color: rgba(255, 255, 255, .55);
    transition: background-color 180ms ease, border-color 180ms ease;
  }
  body.digby-site .menu-toggle:is(:hover, :focus-visible, [aria-expanded="true"]) { background-color: rgba(255, 255, 255, .12); border-color: #fff; }
  body.digby-site.digby-interactive .site-header nav {
    display: flex;
    top: var(--digby-nav-height);
    max-height: calc(100dvh - var(--digby-nav-height) - var(--digby-admin-offset));
    overflow-y: auto;
    background: #102339;
    border-bottom: 1px solid #52647b;
    padding: 16px 24px 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 220ms ease, transform 280ms var(--digby-ease), visibility 0s 280ms;
  }
  body.digby-site.digby-interactive .site-header nav.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition-delay: 0s;
  }
  body.digby-site .site-header nav a { min-height: 48px; }
}
@media (max-width: 782px) { body.digby-site.admin-bar { --digby-admin-offset: 46px; } }
@media (max-width: 540px) {
  body.digby-home .hero-inner { padding-top: calc(44px + var(--digby-header-overlap)); }
}
@media (prefers-reduced-motion: reduce) {
  body.digby-site *, body.digby-site *::before, body.digby-site *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  body.digby-site :is(.button, .dgp-button, .dgp-filter-actions button, .text-link b, .button b, .dgp-card-action span),
  body.digby-site :is(.dgp-card, .team-card, .insight-card) img { transform: none !important; }
}
