/* ==========================================================================
   Stonebridge Financial Management
   Mobile-first. Breakpoints:  600px (large phone / small tablet)
                               769px (desktop layout: tabbed home page, same as the original design)
   ========================================================================== */

:root {
  --blue: #34476C;
  --navy: #1E2A39;
  --footer: #1A2632;
  --ink: #2B333A;
  --grey: #B5B5B5;
  --error: #D7244C;
  --font: futura-pt, "Futura", "Century Gothic", "Trebuchet MS", sans-serif;
  --shadow: 0 0 37px rgba(40, 56, 145, .1), 0 0 37px rgba(40, 56, 145, .1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--footer);
  color: #000;
  font: 400 16px/1.5 var(--font);
  overflow-wrap: break-word;
}
img { display: block; max-width: 100%; height: auto; }
a { color: #00f; }
button, input, textarea { font: inherit; }
p { margin: 0; }
h1, h2 { margin: 0; font-weight: inherit; font-size: inherit; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px;
  background: #fff; color: #000; border-radius: 4px; transition: top .15s;
}
.skip-link:focus { top: 8px; }
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
:focus-visible { outline: 3px solid #f5b800; outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Background (phones and tablets): a fixed picture behind the page
   -------------------------------------------------------------------------- */
body::before, .backdrop {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background: var(--footer) url("../../images/sea-1920.jpg") center top / cover no-repeat;
}
.backdrop { display: block; }
body.inner::before { display: none; }   /* inner pages use the .backdrop element */

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */
.card {
  position: relative; z-index: 1;
  width: min(100% - 32px, 560px);
  margin: 56px auto 28px;
  padding: 20px 18px 28px;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.card--inner { margin-top: 84px; }
.card-logo { margin: 0 auto 18px; width: auto; max-width: min(251px, 100%); }
.card--inner .card-logo { max-width: 213px; }

.back {
  position: absolute; top: 0; left: 0; z-index: 5;
  width: 132px; height: 44px;
  background: var(--blue); color: #fff;
  font: 600 20px/44px var(--font); text-align: center; text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.back:hover, .back:focus-visible { background: var(--navy); }

/* Copy */
.copy { font-size: 16px; line-height: 1.5; text-align: left; }
.copy a { color: #00f; }
.copy--welcome { color: var(--ink); }
.lead { font-weight: 500; }
.name { font-size: 20px; line-height: 24px; font-weight: 400; }
.copy--inner .name { margin-bottom: 4px; }

@media (min-width: 480px) {
  .copy { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
}

/* Navigation buttons */
.buttons { display: grid; gap: 8px; justify-items: center; margin: 24px 0 0; }
.btn {
  display: block; width: min(100%, 222px);
  background: var(--blue); color: #fff;
  font: 600 20px/44px var(--font); text-align: center; text-decoration: none;
  border-radius: 7px; box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.btn:hover, .btn:focus-visible { background: var(--navy); color: #fff; }

/* Footer */
.footer { background: var(--footer); color: #fff; padding: 18px 16px 26px; text-align: center; }
.footer a { color: #fff; }
.legal { display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; font: 500 12px/1.45 var(--font); color: rgba(255, 255, 255, .92); }
.legal p { margin: 0; }
.legal > p, .legal > div { order: 3; }
.legal__privacy { order: 1 !important; margin-bottom: 6px !important; }
.legal__property { order: 2 !important; margin-bottom: 10px !important; }
.details { display: none; }
.footer--inner .legal { display: block; }
.footer--inner .legal p + p { margin-top: 0; }

/* Dialog shown before leaving the site */
.leave {
  width: min(475px, calc(100% - 32px)); padding: 20px 24px 18px;
  border: 1px solid var(--grey); background: #fff; color: #000;
  box-shadow: 0 0 8px rgba(255, 255, 255, .5), 0 0 30px rgba(0, 0, 0, .35);
}
.leave::backdrop { background: rgba(0, 0, 0, .45); }
.leave p { font: 400 16px/1.4 var(--font); }
.leave__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.leave__yes, .leave__no {
  display: inline-block; padding: 8px 18px; min-height: 44px;
  font: 400 16px/28px var(--font); text-align: center; text-decoration: none; cursor: pointer;
}
.leave__yes { background: #fff; color: var(--navy); border: 1px solid var(--navy); box-shadow: 0 0 8px rgba(30, 42, 57, .12); }
.leave__no { background: var(--navy); color: #fff; border: 1px solid var(--navy); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.enquiry input[type="text"], .enquiry input[type="tel"], .enquiry input[type="email"], .enquiry textarea {
  display: block; width: 100%; min-height: 44px;
  padding: 10px 12px; border: 1px solid var(--grey); border-radius: 4px;
  background: #fff; color: #000; font-size: 16px; line-height: 1.3;
}
.enquiry textarea { min-height: 150px; resize: vertical; }
.enquiry ::placeholder { color: var(--grey); opacity: 1; }
.enquiry .is-invalid { border-color: var(--error) !important; }
.enquiry__fields, .enquiry__message { display: grid; gap: 10px; }
.enquiry__fields { margin-bottom: 10px; }
.submit {
  min-height: 44px; min-width: 154px; padding: 0 20px; border: 0; border-radius: 4px;
  background: var(--navy); color: #fff; font: 600 16px/44px var(--font); cursor: pointer;
  justify-self: center;
}
.submit:hover, .submit:focus-visible { background: var(--blue); }
.submit[disabled] { opacity: .6; cursor: wait; }
.status { margin-top: 10px; font: 400 14px/1.3 var(--font); }
.status--sending { color: #555; }
.status--error { color: var(--error); font-weight: 600; }
.status--ok { color: #1a7f37; font-weight: 600; }
.status[hidden] { display: none; }
.enquiry--contact ::placeholder { font-style: italic; }
.consent { display: flex; gap: 10px; align-items: flex-start; color: #666; font: 400 13px/1.25 var(--font); }
.consent input { flex: none; margin: 2px 0 0; width: 18px; height: 18px; }
.consent.is-invalid { outline: 2px solid var(--error); outline-offset: 2px; }
.enquiry__send { display: grid; gap: 12px; }
.enquiry--home .status { color: #fff; }
.enquiry--home .status--error { color: #ff9db3; }
.enquiry--home .status--ok { color: #9ee6b0; }

/* --------------------------------------------------------------------------
   Phones and tablets: home page
   -------------------------------------------------------------------------- */
body.home .card-logo { max-width: 251px; }
body.home h1 { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }  /* heading is read out, not shown, as on the original phone view */
.panel { display: none; }
.panel[data-panel="home"] { display: block; }
.stage > .masthead, .stage > .tabs, .badges, .rocks, .lower { display: none; }
.stage { position: relative; }
.footer .details { display: none; }

/* Inner pages */
.copy--inner p + p { margin-top: 0; }
.infographic { margin: 18px 0 18px; text-align: center; }
.infographic img { margin: 0 auto; }
.infographic figcaption { margin-top: 8px; font-size: 16px; }
.person-inner { margin-bottom: 20px; }
.person-inner .person__photo { width: 132px; height: 132px; margin: 0 auto 12px; border-radius: 50%; object-fit: cover; }
.contact-intro { margin-top: 26px; }
.contact-intro .lead { font-size: 16px; line-height: 19px; font-weight: 500; }
.contact-details { margin-top: 22px; display: grid; gap: 18px; }
.contact-details .copy { font-size: 14px; line-height: 1.2; text-align: left; }
.contact-details a.tel { color: inherit; text-decoration: none; }
.page-contact .card--inner .buttons { margin-top: 32px; }
.social { display: flex; gap: 13px; justify-content: center; margin: 0; }
.social a { display: block; padding: 8px 4px; }
.social--inner { position: relative; z-index: 1; margin: 0 0 4px; }
.social--inner img { width: auto; }
a.tel { color: inherit; text-decoration: none; }

/* Tablet portrait and large phones */
@media (min-width: 600px) and (max-width: 768px) {
  .card { width: min(100% - 80px, 640px); padding: 28px 40px 36px; }
  .copy { font-size: 17px; }
  .card--inner .card-logo { max-width: 240px; }
  .btn { width: 260px; }
  .legal { font-size: 13px; }
  .page-contact .card--inner { max-width: 560px; }
}

/* --------------------------------------------------------------------------
   Inner pages on wider screens: keep the card a readable width
   -------------------------------------------------------------------------- */
@media (min-width: 769px) {
  .card--inner { width: min(100% - 80px, 640px); padding: 28px 40px 36px; }
  .page-contact .card--inner { width: min(100% - 80px, 560px); }
  body.inner::before { display: none; }
}

/* ==========================================================================
   DESKTOP HOME PAGE  (769px and up) — reproduces the original design
   The tabbed layout needs JavaScript; without it the home panel and the
   links to the individual pages are shown.
   ========================================================================== */
@media (min-width: 769px) {
  body.home {
    background: var(--footer) url("../../images/sea-3200.jpg") center top / max(100%, 3797px) auto no-repeat;
  }
  body.home::before { display: none; }

  .stage > .masthead, .stage > .tabs, .badges, .rocks, .lower { display: block; }
  .badges { display: flex; }
  body.home .card-logo, body.home .buttons { display: none; }
  body.home h1 { position: static !important; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }

  .stage { min-height: 1919px; }
  /* soft white glow behind the logo */
  .stage::before {
    content: ""; position: absolute; top: 0; left: 50%; width: 632px; height: 230px; margin-left: -317px; z-index: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), #fff 25%, #fff 75%, rgba(255, 255, 255, 0));
    border-radius: 30px 30px 0 0;
  }

  .masthead { position: absolute; top: 6px; left: 50%; margin-left: -106px; z-index: 6; }
  .masthead img { width: 212px; height: 120px; }

  .tabs { position: absolute; top: 129px; left: 50%; width: 682px; margin-left: -340px; z-index: 5; }
  .tabs ul { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
  .tabs li:nth-child(1) { width: 131px; } .tabs li:nth-child(2) { width: 133px; }
  .tabs li:nth-child(3) { width: 142px; } .tabs li:nth-child(4) { width: 135px; }
  .tabs li:nth-child(5) { width: 131px; }
  .tabs a {
    display: block; height: 40px; background: var(--blue); color: #fff;
    font: 600 15px/38px var(--font); text-align: center; text-decoration: none;
    border-radius: 7px 7px 0 0; white-space: nowrap;
  }
  .tabs a:hover, .tabs a[aria-current], .tabs a[aria-selected="true"] { background: var(--navy); }

  .card-wrap { position: relative; padding-top: 169px; }
  body.home .card {
    width: 707px; min-height: 640px; margin: 0 auto; padding: 0 37px;
  }
  .rocks {
    position: absolute; left: 0; right: 0; top: calc(100% - 172px); height: 1068px; z-index: 2;
    background: url("../../images/rocks-2000.webp") center / cover no-repeat; pointer-events: none;
  }

  /* panels (only the active one is shown once JavaScript has started) */
  .js .panel { display: none; }
  .js .panel.is-active { display: block; }
  .no-js .panel:not([data-panel="home"]) { display: none; }
  .panel[data-panel="home"] { padding-top: 21px; }

  body.home h1 { font: 600 30px/36px var(--font); padding-left: 2px; }
  body.home .copy--welcome { margin-top: 4px; font: 400 15px/18px var(--font); color: var(--ink); text-align: justify; }
  .badges { justify-content: center; align-items: center; gap: 56px; margin-top: 4px; }
  .badges img { object-fit: cover; }
  .badges img:nth-child(1) { width: 69px; height: 58px; margin-top: 3px; }
  .badges img:nth-child(2) { width: 88px; height: 62px; }
  .badges img:nth-child(3) { width: 56px; height: 56px; margin-top: 3px; }

  .pamphlet, .people { position: relative; padding-top: 23px; }
  .pg, .person { display: none; }
  .pg.is-active, .person.is-active { display: block; }
  .pg__title {
    display: flex; align-items: center; min-height: 47px; margin-top: 0; padding-right: 100px;
    font: 600 20px/24px var(--font); color: #000;
  }
  .pg__title--narrow { max-width: 430px; padding-right: 0; }
  .pg__cols { display: flex; align-items: stretch; gap: 19px; margin-top: 4px; }
  .pg__cols--wide { gap: 10px; }
  .pg__cols--wide .pg__img { margin-right: -5px; }
  .pg__text { flex: 0 1 307px; min-width: 0; display: flex; flex-direction: column; }
  .pg__img { flex: none; margin-left: auto; object-fit: cover; align-self: flex-start; }
  .pg__source { margin-top: auto; text-align: right; font: 400 14px/17px var(--font); }
  .pg__more { margin-top: 16px; }
  .pamphlet .copy, .people .copy { font: 400 14px/17px var(--font); color: #000; text-align: justify; }
  .pager { position: absolute; top: 23px; right: 0; display: flex; }
  .pager button {
    width: 39px; height: 47px; margin: 0; padding: 0 0 12px; border: 1px solid var(--blue);
    background: #fff; color: var(--navy); font: 14px/1 Helvetica, Arial, sans-serif; cursor: pointer;
  }
  .pager button + button { margin-left: -1px; }
  .pager button:hover, .pager button:focus-visible { background: var(--blue); color: #fff; }

  .person__cols { display: flex; gap: 20px; margin-top: 4px; }
  .person__cols .copy { flex: 0 1 461px; }
  .person__photo { flex: none; width: 143px; height: 141px; margin-left: auto; margin-right: 14px; border-radius: 80px; object-fit: cover; }
  .people__nav { position: absolute; top: 431px; left: 10px; display: flex; gap: 8px; }
  .people__nav button {
    width: 199px; height: 34px; border: 0; border-radius: 4px; background: var(--blue); color: #fff;
    font: 600 15px/33px var(--font); cursor: pointer;
  }
  .people__nav button:hover { background: var(--navy); }
  .people__nav button[aria-pressed="true"] { background: var(--navy); box-shadow: 4px 4px 5px rgba(0, 0, 0, .5); }

  /* Lower part: contact form over the water, then the dark footer */
  .lower { position: relative; z-index: 4; height: 783px; }
  .touch { position: absolute; top: 391px; left: 50%; width: 676px; margin-left: -344px; color: #fff; }
  .touch h2 { font: 500 31px/37px var(--font); color: #fff; }
  .touch__text { width: 212px; margin-top: 17px; font: 400 14px/17px var(--font); }
  .touch__scroll {
    position: absolute; top: -16px; left: 149px; width: 527px; margin: 0; text-align: right;
    font: 500 70px/84px var(--font); opacity: var(--fade, 1); pointer-events: none;
  }
  .js .touch__scroll { opacity: var(--fade, 0); }
  .touch .social { justify-content: flex-start; gap: 13px; margin-top: 7px; }
  .touch .social a { padding: 0 0 0 0; }
  .touch .social a:first-child { margin-left: 1px; }
  .touch .social img { width: 27px; height: 25px; }

  .enquiry--home {
    display: grid; grid-template-columns: 205px 443px; column-gap: 28px; margin-top: 56px;
    font-family: var(--font);
  }
  .enquiry--home .enquiry__fields { margin: 0; gap: 10px; }
  .enquiry--home input[type="text"], .enquiry--home input[type="tel"], .enquiry--home input[type="email"] {
    height: 47px; padding: 0 10px; border: 0; border-radius: 7px; font-size: 16px;
  }
  .enquiry--home .enquiry__message { gap: 0; background: #fff; border-radius: 7px; height: 217px; padding: 6px; display: flex; flex-direction: column; }
  .enquiry--home textarea { flex: 1; border: 0; border-radius: 0; padding: 4px 4px; min-height: 0; resize: none; font-size: 16px; line-height: 16px; }
  .enquiry--home .enquiry__send { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 0 0 0 4px; }
  .enquiry--home .consent { width: 288px; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 13px; }
  .enquiry--home .consent input { width: 16px; height: 16px; margin-top: 1px; }
  .enquiry--home .submit { width: 125px; min-width: 0; height: 39px; min-height: 0; padding: 0; line-height: 26px; font-size: 16px; justify-self: auto; margin: 0 0 0 auto; }
  .enquiry--home .status { grid-column: 1 / -1; margin-top: 10px; }

  .footer { position: relative; z-index: 3; height: 327px; padding: 49px 0 0; }
  .footer .details {
    display: grid; grid-template-columns: 179px 1fr; row-gap: 5px; width: 676px; margin: 0 auto; text-align: left;
  }
  .details p { font: 500 15px/26px var(--font); }
  .details .details__label { font: 700 16px/27px var(--font); }
  .details__note { max-width: 429px; }
  .legal { display: block; margin-top: 16px; font: 500 12px/14px var(--font); }
  .legal > p, .legal > div { order: 0; }
  .legal__property, .legal__privacy { margin: 0 !important; }
  .legal__property { margin-top: 10px !important; }
  .legal__privacy { margin-top: 6px !important; }
  .legal a { color: #fff; }
  .legal__privacy a { opacity: .75; }
}

@media print {
  .backdrop, body::before { display: none; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  .skip-link { transition: none; }
}
