/* ==========================================================================
   Financialfirst — design stylesheet

   THIS IS THE FILE YOU BUILD THE SITE IN.

   It ships a deliberately plain but complete skeleton: a fixed header that
   goes transparent over a banner and compacts on scroll, a mobile drawer,
   buttons, section/container rhythm, the page banner, the team grid, and the
   footer. Restyle all of it. The structure is here so a fresh install looks
   like a website rather than unstyled markup.

   Tokens live in style.css section 1. Reference them with var(--token) —
   never hardcode a hex here, or Theme Options colours stop working.

   Order: base → layout → header → nav → footer → components → responsive.
   ========================================================================== */

/* ==========================================================================
   1. Base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-dark);
}

h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.6rem); }

p { margin: 0 0 1.25em; }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 150ms ease-out;
}

a:hover,
a:focus {
  color: var(--color-secondary);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Visible keyboard focus everywhere. Do not remove without replacing it. */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }

/* ==========================================================================
   2. Layout

   .container is the shared measure for every section. Keep content inside
   one — a narrow column left-hugging a wide section reads as broken.
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(48px, 7vw, 96px);
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-dark {
  background: var(--color-dark);
  color: var(--color-white);
}

.section-dark h1,
.section-dark h2,
.section-dark h3 {
  color: var(--color-white);
}

/*
 * Body copy keeps a readable measure — but a narrow measure must inherit its
 * section's alignment. Centring the measure inside a left-aligned section
 * strands it in the middle with the heading hard left, which reads as broken.
 *
 * So: .section-body is narrow but NOT auto-centred. When a section should be
 * centred, centre the whole thing with .section-centered below, so the
 * heading, the measure and the button all agree.
 */
.section-body {
  max-width: 70ch;
}

.section-centered {
  text-align: center;
}

.section-centered .section-body,
.section-centered .section-title {
  margin-inline: auto;
}

/* A headline running the full 1200px container is unreadable. Cap it. */
.section-centered .section-title {
  max-width: 22ch;
}

/* The front page has no banner, so its first section sits under the fixed,
   transparent header and has to clear it itself. */
.section-hero {
  padding-top: calc(var(--header-height) + clamp(32px, 5vw, 72px));
}

.wysiwyg-content > *:last-child {
  margin-bottom: 0;
}

.eyebrow {
  margin-bottom: 0.75em;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
}

/* ==========================================================================
   3. Header

   Transparent at rest on every page. The front page's hero paints its own
   background behind it; interior pages get `has-banner` on <body>, which
   reverses the logo and nav to white over the banner image. Past 80px of
   scroll main.js adds `.is-compact`, which paints the header and shrinks it.
   ========================================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background-color 200ms ease-out, height 200ms ease-out,
    box-shadow 200ms ease-out;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter);
}

.site-logo img {
  width: auto;
  height: 40px;
  transition: height 200ms ease-out, filter 200ms ease-out;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Reversed over a banner image. */
.has-banner .site-header:not(.is-compact) .site-logo img {
  filter: brightness(0) invert(1);
}

.has-banner .site-header:not(.is-compact) .main-nav a {
  color: var(--color-white);
}

/* Compacted on scroll. */
.site-header.is-compact {
  height: var(--header-height-compact);
  background: var(--color-white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.site-header.is-compact .site-logo img {
  height: 32px;
}

/* Interior pages start under the fixed header; the front page's hero sits
   beneath it by design. */
.has-banner .site-inner {
  padding-top: 0;
}

/* ==========================================================================
   4. Navigation
   ========================================================================== */

.main-nav .nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav .nav-menu a {
  display: block;
  padding-block: 6px;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.main-nav .nav-menu > li {
  position: relative;
}

.main-nav .nav-menu > li > a::after {
  content: '';
  display: block;
  height: 2px;
  margin-top: 4px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms ease-out;
}

.main-nav .nav-menu > li:hover > a::after,
.main-nav .nav-menu > li:focus-within > a::after,
.main-nav .nav-menu > li.current-menu-item > a::after {
  transform: scaleX(1);
}

/* Dropdowns. */
.main-nav .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: var(--color-white);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease-out, visibility 200ms ease-out;
}

.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
}

.main-nav .sub-menu a {
  padding: 8px 20px;
  color: var(--color-text);
  font-weight: 400;
  text-transform: none;
}

.main-nav .sub-menu a:hover,
.main-nav .sub-menu a:focus {
  background: var(--color-bg-alt);
  color: var(--color-primary);
}

.header-cta {
  padding: 10px 20px;
  border: 2px solid currentColor;
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 200ms ease-out, color 200ms ease-out;
}

.header-cta:hover,
.header-cta:focus {
  background: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
}

.has-banner .site-header:not(.is-compact) .header-cta {
  color: var(--color-white);
}

/* Hamburger. */
.hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.hamburger-box {
  position: relative;
  display: block;
  width: 26px;
  height: 18px;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  transition: transform 200ms ease-out, opacity 200ms ease-out;
}

.hamburger-inner { top: 8px; }
.hamburger-inner::before { content: ''; top: -8px; }
.hamburger-inner::after { content: ''; top: 8px; }

.has-banner .site-header:not(.is-compact) .hamburger-inner,
.has-banner .site-header:not(.is-compact) .hamburger-inner::before,
.has-banner .site-header:not(.is-compact) .hamburger-inner::after {
  background: var(--color-white);
}

.hamburger[aria-expanded='true'] .hamburger-inner {
  transform: rotate(45deg);
}

.hamburger[aria-expanded='true'] .hamburger-inner::before {
  opacity: 0;
}

.hamburger[aria-expanded='true'] .hamburger-inner::after {
  transform: rotate(-90deg) translateX(8px);
}

/* Mobile drawer. */
.mobile-navigation {
  position: fixed;
  inset: var(--header-height) 0 auto;
  z-index: 99;
  max-height: 0;
  overflow: hidden;
  background: var(--color-white);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transition: max-height 300ms ease-out;
}

.mobile-navigation.is-open {
  max-height: 80vh;
  overflow-y: auto;
}

.mobile-navigation .nav-menu,
.mobile-navigation .sub-menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mobile-navigation a {
  display: block;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--color-rule);
  color: var(--color-text);
  font-family: var(--font-heading);
  font-weight: 600;
  text-decoration: none;
}

.mobile-navigation .sub-menu a {
  padding-left: calc(var(--gutter) + 20px);
  font-weight: 400;
}

/* ==========================================================================
   5. Page banner
   ========================================================================== */

.entry-header {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 60vh;
  padding: var(--header-height) var(--gutter) 48px;
  overflow: hidden;
}

.entry-header .image-background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.entry-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.15));
}

.entry-header .page-title {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  color: var(--color-white);
}

/* ==========================================================================
   6. Components
   ========================================================================== */

.button {
  display: inline-block;
  padding: 14px 28px;
  background: var(--color-primary);
  border: 0;
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 200ms ease-out, transform 200ms ease-out;
}

.button:hover,
.button:focus {
  background: var(--color-secondary);
  color: var(--color-white);
  text-decoration: none;
}

.button:active {
  transform: scale(0.98);
}

/* Team archive. */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 40px;
}

.team-card-photo img {
  width: 100%;
  aspect-ratio: 1;
  max-width: 100%;
  object-fit: cover;
}

.team-card-meta h3 {
  margin-top: 16px;
  margin-bottom: 4px;
}

.team-card-role {
  margin-bottom: 1em;
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: 0.9375rem;
}

/* Single team member. */
.staff-grid {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.staff-role {
  margin-top: -0.5em;
  color: var(--color-primary);
  font-family: var(--font-heading);
}

/* ==========================================================================
   7. Footer
   ========================================================================== */

.site-footer {
  padding-block: clamp(48px, 6vw, 80px) 0;
  background: var(--color-dark);
  color: var(--color-white);
}

.site-footer a {
  color: var(--color-white);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 48px;
}

.footer-menu .nav-menu,
.footer-menu .sub-menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-menu a {
  display: block;
  padding-block: 6px;
  font-family: var(--font-heading);
  text-decoration: none;
}

.social-media {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.social-media a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  color: var(--color-white);
  transition: background-color 200ms ease-out, border-color 200ms ease-out;
}

.social-media a:hover,
.social-media a:focus {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.footer-legal {
  margin-top: 48px;
  padding-block: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-legal p {
  margin: 0;
  font-size: 0.875rem;
  opacity: 0.75;
}

/* ==========================================================================
   8. Responsive

   `large` is the breakpoint the header switches on. .show-for-large /
   .hide-for-large need !important — components later in the file set their
   own display and win on equal specificity.
   ========================================================================== */

.show-for-large { display: none !important; }
.hide-for-large { display: block !important; }

@media (min-width: 64em) {
  .show-for-large { display: flex !important; }
  .hide-for-large { display: none !important; }
}

@media (max-width: 63.99em) {
  .staff-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .entry-header {
    min-height: 0;
    padding-top: calc(var(--header-height) + 32px);
  }
}

/* ==========================================================================
   Coming Soon landing page — partials/section-coming-soon.php

   One full-viewport band on the client's deep-blue texture photo. Intro is a
   centred measure; the three detail blocks below it fill the container as a
   three-up row split by hairlines, so neither half strands to one side.
   ========================================================================== */

.section-coming-soon {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(64px, 10vh, 120px) 0;
  background-color: var(--color-bg);
  background-image: url('../media/bg-texture-800.webp');
  background-size: cover;
  background-position: center;
  color: var(--color-text);
  isolation: isolate;
}

@media (min-width: 801px) {
  .section-coming-soon { background-image: url('../media/bg-texture-1200.webp'); }
}

@media (min-width: 1201px) {
  .section-coming-soon { background-image: url('../media/bg-texture-1800.webp'); }
}

/* Even navy wash (calms the grain behind small type) plus a vignette that
   deepens the edges. */
.section-coming-soon::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 0%, color-mix(in srgb, var(--color-bg) 55%, transparent) 100%),
    color-mix(in srgb, var(--color-bg) 40%, transparent);
  pointer-events: none;
}

.coming-soon-inner {
  width: 100%;
  text-align: center;
}

.coming-soon-intro {
  max-width: 44rem;
  margin: 0 auto;
}

.coming-soon-title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(3.5rem, 2rem + 7vw, 8rem);
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--color-white);
}

.coming-soon-rule {
  display: block;
  width: 72px;
  height: 1px;
  margin: clamp(24px, 4vh, 36px) auto;
  background: var(--color-accent);
}

.coming-soon-lede {
  margin: 0;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  line-height: 1.75;
  color: var(--color-text-soft);
  text-wrap: pretty;
}

.coming-soon-details {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: clamp(48px, 8vh, 88px);
  border-top: 1px solid var(--color-rule);
}

.coming-soon-detail {
  padding: 32px 8px;
}

.coming-soon-detail + .coming-soon-detail {
  border-top: 1px solid var(--color-rule);
}

.coming-soon-label {
  margin: 0 0 14px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  text-wrap: balance;
}

.coming-soon-detail p {
  max-width: 34rem;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text-soft);
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.coming-soon-detail a {
  color: var(--color-white);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--color-accent) 60%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 150ms ease-out, text-decoration-color 150ms ease-out;
}

.coming-soon-detail a:hover,
.coming-soon-detail a:focus-visible {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

.section-coming-soon :focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (min-width: 900px) {
  .coming-soon-details {
    grid-template-columns: repeat(3, 1fr);
  }

  .coming-soon-detail {
    padding: 40px clamp(20px, 3vw, 48px) 8px;
  }

  .coming-soon-detail + .coming-soon-detail {
    border-top: 0;
    border-left: 1px solid var(--color-rule);
  }
}

/* Entrance: content rises in once. Pure CSS, so it is visible without JS,
   and skipped entirely under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .coming-soon-intro,
  .coming-soon-details {
    animation: coming-soon-rise 900ms cubic-bezier(0.33, 1, 0.68, 1) both;
  }

  .coming-soon-details {
    animation-delay: 200ms;
  }
}

@keyframes coming-soon-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
