/* Shared site chrome: header, footer, mobile drawer, enquiry modal.
   Visual values are taken 1:1 from the Projects page export (apex-projects/Projects.dc.html). */

:root { --site-header-h: 76px; --apex-navy: #111f43; --apex-accent: #d7c2a3; --apex-cream: #fbf6f0; }

/* The dc-runtime injects html,body{height:100%}; that would trap the sticky header inside
   the first viewport and stack the footer on top of content. Keep document height natural. */
:root { height: auto; }
html body { height: auto; margin: 0; background: #fbf6f0; }
main#main > #dc-root, main#main > #dc-root > .sc-host { height: auto; }
main#main { display: block; }

[hidden].sd-root, [hidden].enq-root, .enq-root [hidden] { display: none !important; }
html.apex-lock, html.apex-lock body { overflow: hidden; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 300; background: var(--apex-accent); color: var(--apex-navy) !important; padding: 10px 16px; font: 500 13px/1.2 'Inter', sans-serif; }
.skip-link:focus { top: 12px; }

/* Hide the footer until the page body has rendered, so it never flashes under the header. */
body:not(.dc-ready) .site-footer { visibility: hidden; }

/* ---------------- Header ---------------- */
.site-header, .site-header *, .site-footer, .site-footer * { box-sizing: content-box; }
.site-header {
  position: sticky; top: 0; z-index: 90;
  background: linear-gradient(120deg, #0e1a3a 0%, #2a3f6b 50%, #0e1a3a 100%);
  font-family: 'Inter', sans-serif; line-height: normal; -webkit-text-size-adjust: 100%;
}
/* Home: the hero is designed to sit under a fixed header (as in the Home export). */
body[data-page="home"] .site-header { position: fixed; left: 0; right: 0; }

.site-header .sh-bar {
  max-width: 1600px; margin: 0 auto; padding: 0 clamp(24px, 4vw, 64px); height: 76px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.site-header .sh-logo { display: block; flex: none; }
.site-header .sh-logo img { height: 60px; width: auto; object-fit: contain; display: block; }
.site-header .sh-nav { display: flex; align-items: center; gap: clamp(18px, 2.6vw, 40px); flex-wrap: wrap; }
.site-header a.sh-link, .site-header a.sh-link:hover, .site-header a.sh-link:visited {
  display: block; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
  color: #fbf6f0; padding: 6px 0; border-bottom: 1px solid transparent; transition: color .2s ease;
}
.site-header a.sh-link:hover { color: var(--apex-accent); }
.site-header a.sh-link[aria-disabled="true"], .sd-root .sd-nav a[aria-disabled="true"] { cursor: default; }
.site-header a.sh-link.is-active { color: var(--apex-accent); border-bottom-color: var(--apex-accent); }

.site-header a.sh-cta, .site-header a.sh-cta:visited {
  flex: none; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
  background: var(--apex-accent); padding: 14px 28px; color: #111f43; white-space: nowrap; transition: background .2s ease;
}
.site-header a.sh-cta:hover { background: #fbf6f0; color: #111f43; }
.site-header a:focus-visible, .site-header button:focus-visible { outline: 2px solid var(--apex-accent); outline-offset: 3px; }

/* Projects mega-menu */
.site-header .sh-dd { position: relative; }
.site-header .sh-dd-panel {
  position: absolute; top: 100%; left: 50%; transform: translate(-50%, 6px); padding-top: 14px;
  opacity: 0; visibility: hidden; transition: opacity .2s ease, transform .2s ease, visibility .2s; z-index: 60;
}
.site-header .sh-dd:hover .sh-dd-panel, .site-header .sh-dd:focus-within .sh-dd-panel { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.site-header .sh-dd-bar {
  position: relative; display: flex; align-items: center; gap: 8px; background: #1e1e1e; padding: 12px;
  border-radius: 4px; box-shadow: 0 18px 40px rgba(0,0,0,0.28); white-space: nowrap;
}
.site-header a.sh-dd-cat, .site-header a.sh-dd-cat:hover {
  display: block; font-size: 15px; font-weight: 500; color: #ffffff; padding: 12px 18px; border-radius: 6px;
  background: transparent; transition: background .15s ease; text-decoration: none;
}
.site-header .sh-dd-bar[data-open="completed"] a[data-cat="completed"],
.site-header .sh-dd-bar[data-open="premium"] a[data-cat="premium"],
.site-header .sh-dd-bar[data-open="ongoing"] a[data-cat="ongoing"] { background: #c39a62; }
.site-header .sh-dd-sub { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); padding-top: 12px; }
.site-header .sh-dd-bar[data-open="completed"] [data-sub="completed"],
.site-header .sh-dd-bar[data-open="premium"] [data-sub="premium"],
.site-header .sh-dd-bar[data-open="ongoing"] [data-sub="ongoing"] { display: block; }
.site-header .sh-dd-grid { display: grid; gap: 12px; background: #1e1e1e; padding: 12px; border-radius: 4px; box-shadow: 0 18px 40px rgba(0,0,0,0.28); }
.site-header .sh-dd-grid--3 { grid-template-columns: repeat(3, 170px); }
.site-header .sh-dd-grid--2 { grid-template-columns: repeat(2, 170px); }
.site-header a.sh-dd-card { display: flex; flex-direction: column; border-radius: 4px; overflow: hidden; background: #2a2a2a; text-decoration: none; }
.site-header a.sh-dd-card:hover { background: #33302a; }
.site-header .sh-dd-img { display: block; height: 110px; background: #3a3a3a; overflow: hidden; }
.site-header .sh-dd-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.site-header .sh-dd-name { display: block; padding: 10px 12px; font-size: 13px; font-weight: 500; color: #ffffff; white-space: normal; }

/* Burger (mobile only) */
.site-header .sh-burger {
  display: none; flex-direction: column; justify-content: center; gap: 6px; width: 44px; height: 44px;
  padding: 0 9px; box-sizing: border-box; background: transparent; border: none; cursor: pointer; flex: none;
}
.site-header .sh-burger span { display: block; height: 1.5px; background: #fbf6f0; border-radius: 2px; }

@media (max-width: 960px) {
  .site-header .sh-nav, .site-header .sh-cta { display: none; }
  .site-header .sh-burger { display: flex; }
}

/* ---------------- Mobile drawer ---------------- */
.sd-root { position: fixed; inset: 0; z-index: 190; font-family: 'Inter', sans-serif; line-height: normal; }
.sd-root * { box-sizing: border-box; }
.sd-scrim { position: absolute; inset: 0; background: rgba(6,12,26,.6); animation: apexFade .3s ease; }
.sd-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(318px, 86vw);
  background: linear-gradient(160deg, #0e1a3a 0%, #2a3f6b 100%); border-left: 1px solid rgba(255,255,255,.09);
  box-shadow: -16px 0 46px rgba(0,0,0,.4); display: flex; flex-direction: column; padding: 18px 26px 34px;
  overflow-y: auto; animation: apexDrawerIn .34s cubic-bezier(.22,.8,.3,1);
}
.sd-top { display: flex; align-items: center; justify-content: space-between; }
.sd-top img { height: 52px; width: auto; display: block; }
.sd-close { width: 44px; height: 44px; background: transparent; border: none; color: #fbf6f0; font-size: 26px; line-height: 1; cursor: pointer; font-family: inherit; }
.sd-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.sd-root .sd-nav a, .sd-root .sd-nav a:hover {
  color: #fbf6f0; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,.09);
}
.sd-root .sd-nav a.is-active { color: var(--apex-accent); }
.sd-root a.sd-cta, .sd-root a.sd-cta:hover {
  margin-top: 26px; text-align: center; background: var(--apex-accent); color: #111f43; font-size: 12px;
  letter-spacing: .1em; text-transform: uppercase; padding: 15px 20px; text-decoration: none;
}
.sd-root a.sd-call, .sd-root a.sd-call:hover { margin-top: 16px; text-align: center; color: #c7cfe3; font-size: 13px; text-decoration: none; }
.sd-root a:focus-visible, .sd-root button:focus-visible { outline: 2px solid var(--apex-accent); outline-offset: 3px; }
@keyframes apexFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes apexDrawerIn { from { transform: translateX(100%); } to { transform: none; } }

/* ---------------- Footer ---------------- */
.site-footer {
  position: relative; background: #111f43; overflow: hidden; font-family: 'Inter', sans-serif; line-height: normal;
  padding: clamp(60px,8vw,90px) clamp(24px,4vw,64px) clamp(28px,3vw,36px) clamp(24px,4vw,64px);
}
.site-footer .sf-texture { position: absolute; inset: 0; pointer-events: none; background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.025) 0px, rgba(255,255,255,0.025) 1px, transparent 1px, transparent 10px); }
.site-footer .sf-inner { position: relative; max-width: 1600px; margin: 0 auto; }
.site-footer .sf-cols { display: flex; flex-wrap: wrap; gap: 48px; justify-content: space-between; padding-bottom: 56px; }
.site-footer .sf-col--brand { flex: 2 1 280px; }
.site-footer .sf-col--links { flex: 1 1 150px; }
.site-footer .sf-col--contact { flex: 1 1 220px; }
.site-footer .sf-logo { height: 96px; width: auto; object-fit: contain; display: block; margin-bottom: 24px; }
.site-footer .sf-tagline { font-size: 14px; color: #a9b3cc; line-height: 1.7; max-width: 280px; margin: 0; }
.site-footer .sf-heading { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--apex-accent); margin-bottom: 20px; }
.site-footer .sf-list { display: flex; flex-direction: column; gap: 14px; }
.site-footer .sf-list a, .site-footer .sf-contact a { font-size: 14px; color: #c7cfe3; text-decoration: none; transition: color .2s ease; }
.site-footer .sf-list a:hover, .site-footer .sf-contact a:hover { color: var(--apex-accent); }
.site-footer .sf-contact { display: flex; flex-direction: column; gap: 12px; font-size: 14px; color: #c7cfe3; line-height: 1.6; font-style: normal; }
.site-footer .sf-social { display: flex; gap: 12px; margin-top: 20px; }
.site-footer .sf-social a {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid #4a5a85; display: flex; align-items: center; justify-content: center;
  font-size: 10px; letter-spacing: 0.02em; color: #c7cfe3; text-decoration: none; transition: color .2s ease, border-color .2s ease;
}
.site-footer .sf-social a:hover { border-color: var(--apex-accent); color: var(--apex-accent); }
.site-footer .sf-bottom { border-top: 1px solid #354773; padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer .sf-copy { font-size: 13px; color: #8d99bd; }
.site-footer .sf-legal { display: flex; gap: 24px; }
.site-footer .sf-legal a, .site-footer .sf-legal span { font-size: 13px; color: #8d99bd; text-decoration: none; }
.site-footer .sf-legal a:hover { color: var(--apex-accent); }
.site-footer a:focus-visible { outline: 2px solid var(--apex-accent); outline-offset: 3px; }

/* ---------------- Enquire modal ---------------- */
.enq-root { position: fixed; inset: 0; z-index: 200; line-height: normal; }
.enq-root * { box-sizing: border-box; }
.enq-scrim {
  position: absolute; inset: 0; background: rgba(8,16,38,0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; animation: apexFade .25s ease;
}
.enq-box { width: 100%; max-width: 460px; background: #fbf6f0; box-shadow: 0 30px 80px rgba(0,0,0,0.45); margin: auto; }
.enq-head { position: relative; background: #111f43; padding: 24px 28px 22px 28px; }
.enq-x { position: absolute; top: 14px; right: 16px; width: 32px; height: 32px; border: none; background: transparent; color: #fbf6f0; font-size: 22px; line-height: 1; cursor: pointer; }
.enq-eyebrow { font-family: 'Poppins', sans-serif; font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: #d7c2a3; margin-bottom: 8px; }
.enq-title { font-family: 'Cormorant Garamond', serif; font-weight: 500; font-size: 28px; line-height: 1.1; color: #fbf6f0; }
.enq-title em { color: #d7c2a3; }
.enq-form { display: flex; flex-direction: column; gap: 14px; padding: 22px 28px 26px 28px; margin: 0; }
.enq-field { display: flex; flex-direction: column; gap: 6px; }
.enq-field > span { font-family: 'Poppins', sans-serif; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: #354773; }
.enq-field input, .enq-field textarea, .enq-field select {
  width: 100%; font-family: 'Poppins', sans-serif; font-size: 13px; color: #111f43; background: #ffffff;
  border: 1px solid #d6d9e0; border-radius: 0; padding: 9px 11px; outline: none; margin: 0;
}
.enq-field input:focus, .enq-field textarea:focus, .enq-field select:focus { border-color: #354773; }
.enq-field textarea { resize: vertical; }
.enq-field select.enq-select {
  padding: 9px 34px 9px 11px; appearance: none; -webkit-appearance: none; cursor: pointer; height: 40px; line-height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23354773' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.enq-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.enq-error { margin: 0; font-family: 'Poppins', sans-serif; font-size: 12px; line-height: 1.6; color: #111f43; background: rgba(215,194,163,0.3); padding: 10px 12px; }
.enq-submit {
  margin-top: 2px; font-family: 'Poppins', sans-serif; font-size: 11px; letter-spacing: 0.2em; font-weight: 500; text-transform: uppercase;
  color: #fbf6f0; background: #111f43; border: none; padding: 14px; cursor: pointer; transition: background .2s ease;
}
.enq-submit:hover { background: #1d2f5e; }
.enq-submit[disabled] { opacity: .7; cursor: progress; }
.enq-call { text-align: center; font-family: 'Poppins', sans-serif; font-size: 11px; color: #354773; }
.enq-root .enq-call a { color: #b9975f; text-decoration: none; }
.enq-sent { display: flex; flex-direction: column; gap: 14px; padding: 48px 30px; text-align: center; }
.enq-sent-title { font-family: 'Cormorant Garamond', serif; font-size: 30px; color: #111f43; }
.enq-sent-copy { font-family: 'Poppins', sans-serif; font-size: 15px; color: #354773; line-height: 1.6; }
.enq-close-btn {
  margin-top: 12px; align-self: center; font-family: 'Poppins', sans-serif; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase;
  color: #fbf6f0; background: #111f43; border: none; padding: 16px 36px; cursor: pointer;
}
.enq-root button:focus-visible, .enq-root a:focus-visible { outline: 2px solid #354773; outline-offset: 2px; }

/* ---------------- Refer & Rewards sticky tab popup ----------------
   Open state is driven by site.js (data-refer-open on [data-refer-root]); the popup's own
   inline styles (size, colours, closed state, transitions) come unchanged from each page design.
   "display": popup appears instantly (Home). "fade": opacity transition (About).
   "fade-slide": opacity + slide-in transition (Contact). */
[data-refer-root]:not([data-refer-open]) [data-refer-panel="display"] { display: none; }
[data-refer-root][data-refer-open] [data-refer-panel^="fade"] { opacity: 1 !important; pointer-events: auto !important; }
[data-refer-root][data-refer-open] [data-refer-panel="fade-slide"] { transform: translateX(0) !important; }

@media (prefers-reduced-motion: reduce) {
  .sd-scrim, .sd-panel, .enq-scrim { animation: none; }
  .site-header .sh-dd-panel { transition: none; }
}
