/* Ward Capital London — shared base styles.
   Extracted from the original per-page <style> blocks. */

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #182926;
  font-family: 'Geologica', sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: #99794A; text-decoration: none; }
a:hover { color: #B08D57; }
::selection { background: #99794A; color: #101B17; }
input, select, button, textarea { font-family: inherit; }
input::placeholder, textarea::placeholder { color: #A3AFAC; }

/* Animations used across pages */
@keyframes wcTick  { from { transform: translateX(0); }          to { transform: translateX(-50%); } }
@keyframes wcPulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.72); } }
@keyframes wcFade  { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } }
@keyframes wcRise  { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* Footer live world-desk clocks (built + updated every second by app.js) */
.wc-clock { display: inline-flex; align-items: baseline; gap: 8px; font-family: 'Geologica', sans-serif; font-weight: 500; font-size: 10.5px; letter-spacing: 0.14em; white-space: nowrap; }
.wc-clock .wc-dot  { width: 6px; height: 6px; border-radius: 50%; background: rgba(163,181,175,0.28); align-self: center; transition: background .5s ease, box-shadow .5s ease; }
.wc-clock .wc-city { color: #7D8F89; transition: color .5s ease; }
.wc-clock .wc-time { color: #F3EEE4; font-variant-numeric: tabular-nums; }
.wc-clock .wc-sec  { color: #5B6B66; font-variant-numeric: tabular-nums; margin-left: -8px; transition: color .5s ease; }
.wc-clock.is-open .wc-dot  { background: #B08D57; animation: wcClockPing 2.6s cubic-bezier(.2,.6,.3,1) infinite; }
.wc-clock.is-open .wc-city { color: #A3B5AF; }
.wc-clock.is-open .wc-sec  { color: #99794A; }
@keyframes wcClockPing { 0% { box-shadow: 0 0 0 0 rgba(176,141,87,0.55); } 70% { box-shadow: 0 0 0 6px rgba(176,141,87,0); } 100% { box-shadow: 0 0 0 0 rgba(176,141,87,0); } }
@media (prefers-reduced-motion: reduce) { .wc-clock.is-open .wc-dot { animation: none; } }

/* =====================================================================
   Responsive / mobile
   Inline styles carry high specificity, so overrides use !important and
   target the exact inline patterns produced by the pages.
   ===================================================================== */

img { max-width: 100%; }

/* Mobile navigation toggle + drawer (hidden on desktop) */
.wc-nav-toggle { display: none; }
.wc-mobile-menu { display: none; }

@media (max-width: 768px) {
  /* Safety net on both roots: body alone doesn't always stop viewport panning.
     `clip` (not `hidden`) so the sticky nav keeps working — `hidden` turns
     body into a scroll container and silently kills position:sticky. */
  html, body { overflow-x: hidden; overflow-x: clip; }

  /* Section-header rows (heading + side label): let them wrap instead of
     forcing the row wider than the screen, and tighten the stacked spacing */
  [style*="align-items:flex-end"][style*="justify-content:space-between"] {
    flex-wrap: wrap !important;
    gap: 14px 40px !important;
    margin-bottom: 34px !important;
  }

  /* Long uppercase side labels (e.g. "DECADES OF EXPERIENCE, ONE STANDARD")
     must be allowed to break on narrow screens */
  [style*="letter-spacing:0.16em"][style*="white-space:nowrap"] { white-space: normal !important; }

  /* --- FX ticker: wrap into two rows (labels on top, marquee below) --- */
  .wc-ticker { flex-wrap: wrap !important; height: auto !important; justify-content: space-between !important; }
  .wc-ticker-label, .wc-ticker-side { height: 36px !important; }
  .wc-ticker-label { border-right: none !important; }
  .wc-ticker-side { border-left: none !important; }
  .wc-ticker-track {
    order: 3; flex: 0 0 100% !important; height: 34px;
    display: flex; align-items: center;
    border-top: 1px solid rgba(163,181,175,0.12);
  }

  /* --- Nav: swap desktop links for the hamburger + drawer --- */
  .wc-nav-links, .wc-nav-cta { display: none !important; }
  .wc-nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 0; border: none; cursor: pointer;
    background: transparent; -webkit-tap-highlight-color: transparent;
  }
  .wc-nav-toggle .wc-bar {
    display: block; width: 24px; height: 2px; background: #F3EEE4; border-radius: 2px;
    transition: transform .3s ease, opacity .2s ease;
  }
  .wc-nav-toggle[aria-expanded="true"] .wc-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .wc-nav-toggle[aria-expanded="true"] .wc-bar:nth-child(2) { opacity: 0; }
  .wc-nav-toggle[aria-expanded="true"] .wc-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .wc-mobile-menu {
    display: block; overflow: hidden; max-height: 0;
    background: #101B17; border-top: 1px solid rgba(163,181,175,0.12);
    transition: max-height .35s ease;
    /* Overlay the page instead of pushing content down */
    position: absolute; top: 100%; left: 0; right: 0; z-index: 70;
  }
  .wc-mobile-menu.open { max-height: 82vh; overflow-y: auto; box-shadow: 0 18px 34px rgba(13,23,20,0.55); }
  .wc-mobile-menu .wc-m-link {
    display: block; padding: 16px 24px; font-size: 16px; font-weight: 500;
    color: #C9D6D1; border-bottom: 1px solid rgba(163,181,175,0.08);
  }
  .wc-mobile-menu .wc-m-link.is-active { color: #B08D57; }
  .wc-mobile-menu .wc-m-cta {
    display: block; margin: 18px 24px 26px; text-align: center;
    background: linear-gradient(140deg,#AD8A55,#8F7143); color: #101B17;
    clip-path: polygon(0 0,100% 0,100% calc(100% - 10px),calc(100% - 10px) 100%,0 100%);
    font-size: 15px; font-weight: 600; padding: 15px; letter-spacing: 0.02em;
  }
  /* Scroll-lock while the menu is open. Must sit on html (the scroller),
     not body: overflow:hidden on body un-sticks the sticky nav. */
  html:has(body.wc-menu-open) { overflow-y: hidden; }

  /* --- Side gutters on every section wrapper --- */
  [style*="max-width:1280px"] { padding-left: 20px !important; padding-right: 20px !important; }

  /* --- Sticky sidebars were pinned below the header; let them flow --- */
  [style*="top:132px"] { position: static !important; top: auto !important; }

  /* --- Collapse multi-column content grids to one column --- */
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns:1.2fr 0.8fr"],
  [style*="grid-template-columns:0.9fr 1.1fr"],
  [style*="grid-template-columns:0.85fr 1.15fr"],
  [style*="grid-template-columns:1.05fr 0.95fr"],
  [style*="grid-template-columns:1.15fr 0.85fr"],
  [style*="grid-template-columns:260px 1fr"],
  [style*="grid-template-columns:280px 1fr"],
  [style*="grid-template-columns:1fr minmax(300px,380px)"],
  [style*="grid-template-columns:70px 1fr 1fr 60px"],
  [style*="grid-template-columns:240px 1fr 1fr"],
  [style*="grid-template-columns:180px 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  /* 3-up columns (About locations, home "Trust, speed, expertise"): when
     stacked, drop the desktop-only side paddings and divider borders so
     every box renders the same full width — except Our desk "How the desk
     works" first column, which should keep the same left rule as the rest */
  [style*="grid-template-columns:repeat(3,1fr)"] > [style*="padding:6px 44px 6px 0"]:not(.wc-desk-how-first),
  [style*="grid-template-columns:repeat(3,1fr)"] > [style*="padding:6px 44px;border-left"],
  [style*="grid-template-columns:repeat(3,1fr)"] > [style*="padding:6px 0 6px 44px"] {
    padding: 6px 0 !important;
    border-left: none !important;
  }

  /* Our desk "How the desk works": same grey left line as the other two */
  [style*="grid-template-columns:repeat(3,1fr)"] > .wc-desk-how-first {
    border-left: 1px solid rgba(163,181,175,0.18) !important;
    padding: 6px 0 6px 16px !important;
  }

  /* 4-up stat/step rows → 2-up */
  [style*="grid-template-columns:repeat(4,1fr)"] { grid-template-columns: 1fr 1fr !important; gap: 30px 24px !important; }

  /* Stat rows (all pages): first stat needs the same left rule as the
     other three when stacked */
  .wc-desk-stat-first,
  [style*="grid-template-columns:repeat(4,1fr)"] > [style*="padding:6px 36px 6px 0"] {
    border-left: 1px solid rgba(24,41,38,0.14) !important;
    padding-left: 36px !important;
  }

  /* Footer mega grid → 2-up, with less space before the copyright bar */
  [style*="grid-template-columns:1.4fr 1fr 1fr 1fr 1fr"] { grid-template-columns: 1fr 1fr !important; gap: 34px !important; padding-bottom: 28px !important; }

  /* --- Footer brand column: centre the logo, breathing room below it --- */
  .wc-foot-brand > img { margin: 0 auto 30px; }
  /* TEL / EML / LDN tags: the fixed 20px width forces the letters to stack */
  .wc-foot-brand [style*="width:20px"] { width: auto !important; white-space: nowrap; flex-shrink: 0; }

  /* Tame oversized vertical section padding (targets big content sections,
     not the nav / clocks / footer structure) */
  [style*="padding:108px 40px"], [style*="padding:104px 40px"], [style*="padding:100px 40px"],
  [style*="padding:96px 40px"],  [style*="padding:92px 40px"],  [style*="padding:88px 40px"],
  [style*="padding:84px 40px"],  [style*="padding:80px 40px"],  [style*="padding:78px 40px"],
  [style*="padding:124px 40px"], [style*="padding:120px 40px"], [style*="padding:116px 40px"],
  [style*="padding:72px 40px"],
  [style*="padding:84px 0 88px"], [style*="padding:84px 0 96px"] {
    padding-top: 62px !important; padding-bottom: 62px !important;
  }

  /* Services "02" block is right-aligned on desktop; stacked on mobile it
     should read left-aligned like the other sections */
  .wc-svc-flip { text-align: left !important; }

  /* Long values shouldn't force horizontal scroll */
  a[href^="mailto:"], a[href^="tel:"] { word-break: break-word; }

  /* --- Home hero: map as its own block on top, text below (no overlap).
     The map SVG has a fixed 960x412 viewBox, so size the block to match. --- */
  [data-screen-label="Hero"] > [style*="opacity:0.96"] {
    position: static !important;
    aspect-ratio: 960 / 412;
    margin-top: 10px;
  }
  [data-screen-label="Hero"] > [style*="radial-gradient"] { display: none !important; }
  [data-screen-label="Hero"] > [style*="min-height:calc(100svh - 132px)"] {
    min-height: 0 !important;
    padding: 34px 20px 78px !important;
  }
}

@media (max-width: 480px) {
  [style*="max-width:1280px"] { padding-left: 16px !important; padding-right: 16px !important; }

  /* Final collapse of 2-up layouts on small phones */
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns:1.4fr 1fr 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Services 02: when stacked, show the text block first, list after,
     matching how sections 01 and 03 stack */
  .wc-svc-flip { order: -1 !important; }

  /* Services "Also on the desk": both cards get the same left rule with a
     smaller indent than the desktop 52px */
  [style*="grid-template-columns:1fr 1fr"] > [style*="padding:6px 52px 6px 0"],
  [style*="grid-template-columns:1fr 1fr"] > [style*="padding:6px 0 6px 52px"] {
    border-left: 1px solid rgba(24,41,38,0.16) !important;
    padding: 6px 0 6px 18px !important;
  }
}
