/* --------------------------------------------------------------------------
   mfin1 — component styles.
   Ported verbatim from templates/mfin1/css/styles.css. Design tokens
   (:root) and the html/body base live in the theme's style.css.
   -------------------------------------------------------------------------- */

/* Header: scrolled state */
#site-header.scrolled {
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
#site-header.scrolled .logo-white { display: none; }
#site-header.scrolled .logo-color { display: block; }
#site-header.scrolled .nav-link,
#site-header.scrolled .menu-toggle { color: var(--color-primary); }
#site-header.scrolled .portal-btn {
  color: var(--color-primary);
  border-color: var(--color-primary);
}
#site-header.scrolled .portal-btn:hover {
  background-color: var(--color-primary);
  color: #ffffff;
}

/* Mobile menu open state */
body.menu-open { overflow: hidden; }

/* ------------------------------------------------------------
   Top-level nav: animated gold bar under each link.
   - Hover/focus: bar scales in from center (scaleX 0 -> 1).
   - `.is-active` keeps the bar pinned for the current page.
   ------------------------------------------------------------ */
#site-header .nav-link {
  position: relative;
  padding-bottom: 6px;
}
#site-header .nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--color-secondary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
}
#site-header .nav-link:hover::after,
#site-header .nav-link:focus-visible::after,
#site-header .nav-link.is-active::after {
  transform: scaleX(1);
}

/* ------------------------------------------------------------
   Submenu: white card + staggered item entrance.
   Container visibility is handled by Tailwind utilities on the HTML
   (invisible/opacity-0 + group-hover:visible/group-hover:opacity-100).
   The card + per-item animations below trigger on `.nav-item:hover`.
   ------------------------------------------------------------ */
.nav-submenu-card {
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top center;
  transition: opacity 220ms ease-out, transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nav-item:hover .nav-submenu-card,
.nav-item:focus-within .nav-submenu-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.nav-submenu-card > a {
  opacity: 0;
  transform: translateX(-14px);
  transition: opacity 300ms ease-out, transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1), color 180ms ease-out, background-color 180ms ease-out;
}
.nav-item:hover .nav-submenu-card > a,
.nav-item:focus-within .nav-submenu-card > a {
  opacity: 1;
  transform: translateX(0);
}
.nav-item:hover .nav-submenu-card > a:nth-child(1),
.nav-item:focus-within .nav-submenu-card > a:nth-child(1) { transition-delay: 80ms, 80ms, 0ms, 0ms; }
.nav-item:hover .nav-submenu-card > a:nth-child(2),
.nav-item:focus-within .nav-submenu-card > a:nth-child(2) { transition-delay: 140ms, 140ms, 0ms, 0ms; }
.nav-item:hover .nav-submenu-card > a:nth-child(3),
.nav-item:focus-within .nav-submenu-card > a:nth-child(3) { transition-delay: 200ms, 200ms, 0ms, 0ms; }
.nav-item:hover .nav-submenu-card > a:nth-child(4),
.nav-item:focus-within .nav-submenu-card > a:nth-child(4) { transition-delay: 260ms, 260ms, 0ms, 0ms; }

/* Sub-item active state: gold text for the current page link. */
.nav-submenu-card > a.is-active {
  color: var(--color-secondary);
}

/* ------------------------------------------------------------
   Bio modal (<dialog> element).
   - Native <dialog> handles ESC + focus trap + body scroll lock.
   - @starting-style drives the elegant scale + fade entrance.
   ------------------------------------------------------------ */
dialog.bio-modal,
dialog.content-modal {
  max-width: 1200px;
  width: calc(100% - 2rem);
  max-height: calc(100vh - 4rem);
  padding: 0;
  border: none;
  background: #ffffff;
  color: var(--color-primary);
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.45);
  overflow: visible;
}
dialog.content-modal {
  max-width: 800px;
}
dialog.bio-modal[open],
dialog.content-modal[open] {
  animation: bioModalIn 320ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
dialog.bio-modal::backdrop,
dialog.content-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  animation: bioModalBackdropIn 320ms ease-out both;
}
@keyframes bioModalIn {
  from { opacity: 0; transform: scale(0.94) translateY(18px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes bioModalBackdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Shared modal internals — applies to bio-modal and content-modal */
.content-modal-body {
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  padding: 2rem;
}
@media (min-width: 768px) { .content-modal-body { padding: 3rem; } }
@media (min-width: 1024px) { .content-modal-body { padding: 4rem; } }

.content-modal-close {
  position: absolute;
  top: -1.25rem;
  right: -1.25rem;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 9999px;
  background: var(--color-primary);
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.224rem, 1.172rem + 0.2231vw, 1.35rem);
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  transition: transform 240ms cubic-bezier(0.2, 0.9, 0.3, 1), background-color 200ms ease-out, color 200ms ease-out;
}
.content-modal-close:hover,
.content-modal-close:focus-visible {
  background: var(--color-secondary);
  transform: rotate(90deg) scale(1.05);
  outline: none;
}

.content-modal-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  background: var(--bb-grey-50);
  color: var(--color-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.457rem, 1.336rem + 0.5174vw, 1.75rem);
  flex-shrink: 0;
}

body:has(dialog.bio-modal[open]),
body:has(dialog.content-modal[open]) { overflow: hidden; }

/* Clickable headshot */
.team-card .headshot {
  cursor: pointer;
  transition: opacity 220ms ease-out, transform 320ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.team-card .headshot:hover {
  opacity: 0.92;
  transform: translateY(-2px);
}

/* ------------------------------------------------------------
   Service cards
   ------------------------------------------------------------ */
.service-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--bb-grey-200);
  padding: 2.5rem 2rem;
  cursor: pointer;
  transition: transform 320ms cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 320ms ease-out, border-color 320ms ease-out;
  overflow: hidden;
}
.service-card:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 3px;
}
.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--color-secondary);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 360ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.25);
  border-color: transparent;
}
.service-card:hover::before {
  transform: scaleX(1);
}

.service-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  background: var(--bb-grey-50);
  color: var(--color-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.457rem, 1.336rem + 0.5174vw, 1.75rem);
  margin-bottom: 1.75rem;
  transition: background-color 320ms ease-out, color 320ms ease-out, transform 320ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.service-card:hover .service-icon {
  background: var(--color-primary);
  color: var(--color-secondary);
  transform: scale(1.05);
}

.service-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--color-primary);
  font-size: 0.6875rem;
  letter-spacing: 0.25em;
  font-weight: 600;
  text-transform: uppercase;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: color 220ms ease-out, gap 220ms ease-out;
}
.service-more-btn i {
  font-size: 0.625rem;
  transition: transform 320ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.service-more-btn:hover {
  color: var(--color-secondary);
  gap: 1rem;
}
.service-more-btn:hover i {
  transform: translateX(4px);
}

/* ------------------------------------------------------------
   Process steps — large numeral + title + description row.
   ------------------------------------------------------------ */
.process-step {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 2rem;
  align-items: center;
  padding: 2rem 0;
  border-bottom: 1px solid var(--bb-grey-200);
}
.process-step:last-child { border-bottom: 0; }

@media (min-width: 640px) {
  .process-step {
    grid-template-columns: auto 1fr;
    padding: 2.5rem 0;
  }
}
@media (min-width: 1024px) {
  .process-step {
    grid-template-columns: minmax(140px, 200px) minmax(240px, 360px) 1fr;
    gap: 3rem;
    padding: 3rem 0;
  }
}

.step-number {
  font-family: 'Playfair Display', ui-serif, Georgia, serif;
  font-size: clamp(2.954rem, 2.106rem + 3.617vw, 5rem);
  font-weight: 400;
  line-height: 1;
  color: var(--bb-grey-300);
  letter-spacing: 0.02em;
}

.step-title {
  font-family: 'Playfair Display', ui-serif, Georgia, serif;
  font-size: clamp(1.594rem, 1.426rem + 0.7171vw, 2rem);
  color: var(--color-primary);
  line-height: 1.2;
}

.step-description {
  color: var(--color-text);
  line-height: 1.65;
  max-width: 640px;
}

/* ------------------------------------------------------------
   Contact form
   ------------------------------------------------------------ */
.contact-form {
  display: flex;
  flex-direction: column;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; gap: 1.75rem; }
}
.form-field--full { grid-column: 1 / -1; }

.form-field label {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.6rem;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: #ffffff;
  border: 1px solid var(--bb-grey-200);
  border-radius: 0;
  color: var(--color-primary);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  transition: border-color 200ms ease-out, box-shadow 200ms ease-out, background-color 200ms ease-out;
  appearance: none;
  -webkit-appearance: none;
}
.form-field textarea {
  resize: vertical;
  min-height: 8rem;
}
.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover {
  border-color: var(--bb-grey-300);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgb(var(--color-secondary-rgb) / 0.18);
  background: #ffffff;
}

.select-wrap { position: relative; }
.select-wrap select { padding-right: 2.75rem; cursor: pointer; }
.select-caret {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-primary);
  font-size: 0.6875rem;
  pointer-events: none;
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2.25rem;
  background: var(--color-primary);
  color: #ffffff;
  border: 0;
  font-size: 0.6875rem;
  letter-spacing: 0.25em;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  align-self: flex-start;
  transition: background-color 220ms ease-out, transform 220ms cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 220ms ease-out, gap 220ms ease-out;
}
.submit-btn i { font-size: 0.625rem; transition: transform 320ms cubic-bezier(0.2, 0.9, 0.3, 1); }
.submit-btn:hover {
  background: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px rgb(var(--color-secondary-rgb) / 0.6);
  gap: 1rem;
}
.submit-btn:hover i { transform: translateX(3px); }
.submit-btn:focus-visible {
  outline: 3px solid rgb(var(--color-secondary-rgb) / 0.35);
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   Contact sidebar
   ------------------------------------------------------------ */
.contact-panel {
  background: var(--bb-grey-50);
  padding: 2.5rem 2rem;
  border-top: 4px solid var(--color-secondary);
}
@media (min-width: 1024px) {
  .contact-panel { padding: 3rem 2.5rem; }
}

.contact-info-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--bb-grey-200);
}
.contact-info-row--last { border-bottom: 0; }
.contact-info-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: #ffffff;
  color: var(--color-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.contact-info-label {
  font-size: 0.625rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-secondary);
  margin-bottom: 0.35rem;
}
.contact-info-value {
  color: var(--color-primary);
  font-size: 0.95rem;
  line-height: 1.5;
}
.contact-info-link {
  display: inline-block;
  color: var(--color-primary);
  text-decoration: none;
  transition: color 180ms ease-out;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.contact-info-link:hover { color: var(--color-secondary); }

.contact-social { margin-top: 2rem; padding: 0 2rem; }
@media (min-width: 1024px) {
  .contact-social { padding: 0 2.5rem; }
}

/* Feature card: downward-pointing triangle notch at top-center */
.card-notch {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 14px solid var(--bb-grey-100); /* --bb-grey-100, must match card bg */
}

/* --------------------------------------------------------------------------
   WordPress-specific additions (not present in the static template)
   -------------------------------------------------------------------------- */

/* Keep the fixed header clear of the admin bar. */
body.admin-bar #site-header { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar #site-header { top: 46px; }
}

/* Text wordmark fallback used when no logo is set in Theme Options. */
.site-wordmark {
  font-family: 'Playfair Display', ui-serif, Georgia, serif;
  font-size: clamp(1.527rem, 1.382rem + 0.6159vw, 1.875rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: #ffffff;
  white-space: nowrap;
}
#site-header.scrolled .site-wordmark { color: var(--color-primary); }

/* Classic Editor alignment + caption classes. */
.entry-content .alignleft  { float: left; margin: 0 1.5rem 1rem 0; }
.entry-content .alignright { float: right; margin: 0 0 1rem 1.5rem; }
.entry-content .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.entry-content .wp-caption { max-width: 100%; }
.entry-content .wp-caption-text {
  font-size: 0.8125rem;
  color: var(--bb-grey-500);
  margin-top: 0.5rem;
}

/* Single uploaded logo serves both header states: knocked-out white over the
   transparent header, full colour once the header paints white on scroll. */
#site-header .logo-white { filter: brightness(0) invert(1); }

/* Genesis search form (404 page, search widget). */
.search-form {
  display: flex;
  gap: 0.75rem;
}
.search-form input[type="search"] {
  flex: 1 1 auto;
  padding: 0.875rem 1rem;
  background: #ffffff;
  border: 1px solid var(--bb-grey-200);
  color: var(--color-primary);
  font-family: inherit;
  font-size: 0.95rem;
}
.search-form input[type="search"]:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgb(var(--color-secondary-rgb) / 0.18);
}
.search-form input[type="submit"],
.search-form button[type="submit"] {
  padding: 0.875rem 1.5rem;
  background: var(--color-primary);
  color: #ffffff;
  border: 0;
  font-size: 0.6875rem;
  letter-spacing: 0.25em;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 220ms ease-out;
}
.search-form input[type="submit"]:hover,
.search-form button[type="submit"]:hover {
  background: var(--color-secondary);
}
