/* =============================================================
   IPCogito Legal — Shared design layer
   Loaded LAST on every public page, after any page-level <style>.
   Holds the site-wide tokens and the components every page shares:
   BCI banner, navigation, page header, cards, sidebar, buttons,
   floating actions and the site footer.
   Page files should only keep styles unique to that page.
   ============================================================= */

/* ── Design tokens ── */
:root {
  /* Brand colours */
  --gold: #B5892A;
  --gold-h: #C9991E;
  --gold-dark: #8B6820;
  --dark: #1A2025;
  --slate: #2C3A42;
  --cream: #F8F5EF;
  --off-white: #FAF8F4;
  --white: #FFFFFF;

  /* Text */
  --ink: #1A2025;
  --ink-mid: #3A3A3A;
  --ink-light: #6B7280;
  --muted: #6B7280;
  --accent: #8B6820;

  /* Lines & depth */
  --border: rgba(181,137,42,0.2);
  --border-light: rgba(0,0,0,0.08);
  --shadow: 0 4px 32px rgba(0,0,0,0.08);
  --radius: 2px;

  /* Type */
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', system-ui, sans-serif;
  --mono: 'Jost', system-ui, sans-serif;
  --fs-body: 1rem;        /* 16–17px reading text */
  --fs-small: 0.9rem;     /* card / supporting text */
  --fs-label: 0.72rem;    /* uppercase eyebrow labels */
}

/* Form controls use the site font, not the browser default */
button, input, select, textarea { font-family: inherit; }

/* ── BCI Rule 36 banner: always visible above the navigation ── */
.bci-banner {
  background: var(--dark);
  border-bottom: 0;
  padding: 0.45rem 1rem;
  text-align: center;
  position: relative;
  z-index: 101;
}
.bci-banner p {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.78);
  letter-spacing: 0.03em;
  line-height: 1.5;
  margin: 0;
  text-align: center;
}

/* ── Navigation (sticky, sits below the BCI banner) ── */
.nav { position: sticky; top: 0; left: 0; right: 0; z-index: 100; }
.nav-links a, .nav-link { white-space: nowrap; }
@media (min-width: 901px) and (max-width: 1300px) {
  .nav-links { gap: 1.1rem; }
  .nav-links a, .nav-link { font-size: 0.74rem; letter-spacing: 0.03em; }
  .nav-cta { padding: 0.6rem 1.15rem; }
}
.nav-dropdown { position: relative !important; }
.nav-submenu {
  display: none !important; position: absolute; top: 100%; left: 0;
  background: var(--dark); border-top: 2px solid var(--gold);
  min-width: 220px; padding: 0.5rem 0; z-index: 9999;
  list-style: none !important; margin: 0; box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.nav-submenu li { list-style: none !important; }
.nav-submenu li::marker { content: none !important; }
.nav-submenu li a {
  display: block; padding: 0.65rem 1.25rem; color: #c8bfa8;
  font-size: 0.82rem; letter-spacing: 0.05em; text-transform: uppercase; text-decoration: none;
}
.nav-submenu li a:hover { color: var(--gold); }
.nav-dropdown:hover .nav-submenu,
.nav-dropdown:focus-within .nav-submenu { display: block !important; }
.nav-dropdown > .nav-link::after { content: " \25BE"; font-size: 0.7em; opacity: 0.6; }

/* ── Inner-page header band (breadcrumb · label · H1 · intro) ── */
.page-header {
  background: var(--off-white);
  margin-top: 0;
  padding: 4.5rem 0 3.5rem;
  border-bottom: 1px solid var(--border-light);
}
.page-header h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 1rem;
}
.page-header h1 + p,
.page-header .hero-lead {
  font-family: var(--sans);
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.8;
  max-width: 680px;
}
.page-header .breadcrumb { font-family: var(--sans); font-size: 0.78rem; line-height: 1.6; color: var(--muted); margin-bottom: 1rem; }
.page-header .breadcrumb a { color: var(--gold); }
.page-header .section-label { display: block; margin-bottom: 0.75rem; }
@media (max-width: 600px) {
  .page-header { padding: 3rem 0 2.5rem; }
}

/* Blog article header: same rhythm as .page-header */
.article-header { margin-top: 0; padding: 4.5rem 0 3rem; }
@media (max-width: 600px) { .article-header { padding: 3rem 0 2.5rem; } }

/* ── Eyebrow label ── */
.section-label {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ── Card headings: Cormorant needs a larger size to read evenly ── */
.service-card h3,
.practice-card h3,
.blog-body h3,
.resource-card h3 { font-size: 1.25rem; line-height: 1.3; }
.sidebar-cta h3 { font-size: 1.3rem; }

/* ── Buttons ── */
.btn,
.gate-submit-btn {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius);
}

/* ── Floating actions (bottom-right, stacked) ── */
.wa-float, .tm-float {
  position: fixed; right: 18px; z-index: 120;
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--sans); font-size: 0.76rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
  padding: 0.7rem 1.2rem; border-radius: 999px; color: #FFFFFF; text-decoration: none;
  box-shadow: 0 4px 18px rgba(0,0,0,0.18);
}
.wa-float { bottom: 18px; background: #25D366; }
.wa-float:hover { background: #1EB858; color: #FFFFFF; }
.wa-float:not(:has(svg))::before{content:"";width:16px;height:16px;background:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 3C9.383 3 4 8.383 4 15c0 2.331.682 4.507 1.969 6.414L4 29l7.793-1.938C13.617 28.057 14.791 28.333 16 28.333 22.617 28.333 28 22.95 28 16.333 28 9.717 22.617 4.333 16 4.333V3zm0 2.667c5.166 0 9.333 4.167 9.333 9.333 0 5.167-4.167 9.334-9.333 9.334-1.083 0-2.151-.192-3.17-.567l-.67-.252-4.489 1.117 1.206-4.365-.294-.678C7.786 20.064 7.333 18.548 7.333 17c0-5.166 4.167-9.333 8.667-9.333zM13.11 11.996c-.204-.454-.418-.463-.613-.472-.159-.007-.341-.007-.524-.007-.183 0-.48.069-.732.343-.252.273-.963.94-.963 2.292 0 1.352.986 2.66 1.123 2.845.137.182 1.9 3.047 4.69 4.147 2.321.917 2.794.824 3.295.773.5-.05 1.623-.663 1.85-1.302.227-.639.227-1.187.159-1.302-.068-.114-.25-.182-.524-.319-.273-.137-1.618-.797-1.869-.887-.25-.092-.432-.137-.613.136-.182.273-.703.887-.862 1.07-.159.183-.318.205-.592.068-.273-.137-1.153-.425-2.197-1.351-.813-.725-1.362-1.621-1.521-1.895-.159-.273-.017-.421.12-.558.124-.124.273-.319.41-.478.137-.159.182-.273.273-.455.091-.182.045-.341-.022-.478-.068-.137-.596-1.473-.84-2.01z' fill='%23FFFFFF'/%3E%3C%2Fsvg%3E") no-repeat center center;background-size:contain;}
.tm-float { bottom: 74px; background: var(--gold); }
.tm-float:hover { background: var(--gold-h); color: #FFFFFF; }
.tm-float svg { width: 15px; height: 15px; flex-shrink: 0; }
@media (max-width: 600px) {
  .wa-float, .tm-float { right: 14px; padding: 0.6rem 1rem; font-size: 0.68rem; }
  .wa-float { bottom: 14px; }
  .tm-float { bottom: 64px; }
}

/* ── Site footer (single shared component) ── */
.site-footer {
  background: var(--dark);
  border-top: 3px solid var(--gold);
  padding: 4rem 0 2rem;
  margin: 0;
  text-align: left;
  color: rgba(255,255,255,0.75);
  font-family: var(--sans);
}
.site-footer .sf-wrap { max-width: 1160px; margin: 0 auto; padding: 0 2rem; }
.site-footer .sf-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
.site-footer .sf-brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.site-footer .sf-brand img { height: 44px; width: auto; display: block; }
.site-footer .sf-brand-name {
  font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: #FFFFFF; line-height: 1.2;
}
.site-footer .sf-brand-name span { color: var(--gold); }
.site-footer .sf-brand-sub {
  font-size: 0.62rem; color: rgba(255,255,255,0.5); letter-spacing: 0.1em; text-transform: uppercase;
}
.site-footer .sf-office { font-size: 0.92rem; line-height: 1.9; color: rgba(255,255,255,0.75); font-style: normal; }
.site-footer .sf-office strong { display: block; color: rgba(255,255,255,0.95); font-weight: 500; }
.site-footer .sf-col h2 {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 1.1rem; line-height: 1.4;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 0.55rem; padding: 0; line-height: 1.5; }
.site-footer li::marker { content: none; }
.site-footer a { color: rgba(255,255,255,0.75); font-size: 0.92rem; text-decoration: none; transition: color 0.2s; }
.site-footer a:hover { color: var(--gold); }
.site-footer .sf-disclaimer {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1.75rem;
  font-size: 0.78rem;
  line-height: 1.85;
  color: rgba(255,255,255,0.68);
  max-width: 940px;
}
.site-footer .sf-disclaimer strong {
  display: block; margin-bottom: 0.5rem; color: var(--gold);
  font-size: 0.68rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
}
.site-footer .sf-disclaimer p { margin: 0; line-height: 1.85; color: inherit; font-size: inherit; }
.site-footer .sf-bottom {
  margin-top: 1.5rem; padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  font-size: 0.76rem; color: rgba(255,255,255,0.6);
}
@media (max-width: 960px) {
  .site-footer .sf-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 600px) {
  .site-footer { padding: 3rem 0 6rem; }   /* bottom room for floating buttons */
  .site-footer .sf-wrap { padding: 0 1.25rem; }
  .site-footer .sf-grid { grid-template-columns: 1fr; }
}

/* ── BCI Rule 36 disclaimer gate ("I Agree") ──
   Hidden unless the inline head script adds .bci-gate-open to <html>.
   Without JavaScript the gate never shows, so content is never blocked. */
.bci-gate { display: none; }
.bci-gate-open { overflow: hidden; }
.bci-gate-open .bci-gate {
  display: flex; align-items: center; justify-content: center;
  position: fixed; inset: 0; z-index: 10000;
  padding: 1rem;
  background: rgba(26,32,37,0.86);
  backdrop-filter: blur(3px);
}
.bci-gate-card {
  background: #FFFFFF;
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  width: 100%; max-width: 620px;
  max-height: calc(100vh - 2rem); overflow-y: auto;
  padding: 2.25rem 2.25rem 2rem;
  text-align: left;
  font-family: var(--sans);
}
.bci-gate-label {
  font-size: var(--fs-label); font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 0.5rem;
}
.bci-gate-title {
  font-family: var(--serif); font-weight: 600; font-size: 2rem; line-height: 1.2;
  color: var(--ink); margin: 0 0 1rem;
}
.bci-gate-text p,
.bci-gate-text li { font-size: 0.92rem; line-height: 1.7; color: var(--ink-mid); text-align: left; }
.bci-gate-text p { margin: 0 0 0.75rem; }
.bci-gate-text ul { margin: 0 0 1.5rem 1.15rem; padding: 0; list-style: disc; }
.bci-gate-text li { margin: 0 0 0.45rem; }
.bci-gate-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.bci-gate-agree,
.bci-gate-exit {
  display: inline-block; cursor: pointer;
  font-family: var(--sans); font-size: 0.85rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
  padding: 0.85rem 2rem; border-radius: var(--radius); line-height: 1.2;
}
.bci-gate-agree { background: var(--gold); color: #FFFFFF; border: 1.5px solid var(--gold); }
.bci-gate-agree:hover { background: var(--gold-h); border-color: var(--gold-h); }
.bci-gate-exit { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.bci-gate-exit:hover { background: var(--ink); color: #FFFFFF; }
.bci-gate-agree:focus-visible,
.bci-gate-exit:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 3px; }
@media (max-width: 600px) {
  .bci-gate-card { padding: 1.75rem 1.25rem 1.5rem; }
  .bci-gate-title { font-size: 1.6rem; }
  .bci-gate-agree, .bci-gate-exit { flex: 1; text-align: center; padding: 0.8rem 1rem; }
}

/* ── Long-form practice content (service pages) ── */
.prose-block { margin: 3.5rem 0 1rem; padding-top: 3rem; border-top: 1px solid var(--border-light); }
.prose-block section { margin-bottom: 2.75rem; }
.prose-block h2 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.25; color: var(--ink); margin: 0 0 1rem;
}
.prose-block h3 {
  font-family: var(--sans); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-mid); margin: 1.75rem 0 0.6rem; line-height: 1.5;
}
.prose-block p { font-size: 1rem; line-height: 1.85; color: var(--ink-mid); margin: 0 0 1rem; text-align: left; }
.prose-block ul, .prose-block ol { margin: 0 0 1.25rem 1.25rem; padding: 0; color: var(--ink-mid); }
.prose-block li { font-size: 1rem; line-height: 1.75; margin: 0 0 0.5rem; text-align: left; }
.prose-block strong { color: var(--ink); font-weight: 500; }
.prose-block ol.steps { list-style: none; margin-left: 0; counter-reset: step; }
.prose-block ol.steps li { counter-increment: step; position: relative; padding-left: 3rem; margin-bottom: 1.1rem; }
.prose-block ol.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0.1rem;
  width: 2rem; height: 2rem; border: 1.5px solid var(--gold); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 1rem; color: var(--gold);
}
.prose-block .note {
  background: var(--off-white); border-left: 3px solid var(--gold);
  padding: 1rem 1.25rem; margin: 1.25rem 0 1.5rem; font-size: 0.93rem; line-height: 1.75; color: var(--ink-mid);
}
.prose-block a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ── Knowledge Centre articles ── */
.article-standfirst { font-family: var(--sans); font-size: 1.05rem; color: var(--muted); max-width: 680px; line-height: 1.8; margin: 0; }
.article-author {
  margin: 2.5rem 0 0; padding: 1.25rem 1.5rem;
  border-top: 2px solid var(--gold); background: var(--off-white);
}
.article-author p { font-size: 0.92rem; line-height: 1.7; color: var(--ink-mid); margin: 0 0 0.4rem; }
.article-author .article-author-name { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: var(--ink); margin: 0; }
.article-author .article-author-role { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-dark); margin-bottom: 0.6rem; }

/* ── Service pages: "At a glance" key facts strip ── */
.key-facts { background: #FFFFFF; border-bottom: 1px solid var(--border-light); padding: 1.75rem 0 1.9rem; }
.key-facts .kf-title {
  font-family: var(--sans); font-size: var(--fs-label); font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 1rem;
}
.key-facts .kf-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; }
.key-facts .kf-grid > div { padding: 0.15rem 1.5rem; border-left: 1px solid var(--border); }
.key-facts .kf-grid > div:first-child { padding-left: 0; border-left: 0; }
.key-facts dt {
  font-family: var(--sans); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gold-dark); margin: 0 0 0.4rem;
}
.key-facts dd { margin: 0; font-family: var(--sans); font-size: 0.93rem; line-height: 1.55; color: var(--ink); }
@media (max-width: 900px) {
  .key-facts .kf-grid { grid-template-columns: 1fr 1fr; row-gap: 1.25rem; }
  .key-facts .kf-grid > div:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 480px) {
  .key-facts .kf-grid { grid-template-columns: 1fr; }
  .key-facts .kf-grid > div { padding-left: 0; border-left: 0; }
  .key-facts .kf-grid > div + div { border-top: 1px solid var(--border); padding-top: 1rem; }
}

/* ── Email addresses are never shown in capitals ── */
a[href^="mailto:"] { text-transform: none !important; letter-spacing: 0.02em !important; }

/* ── Long-form reading text: justified with hyphenation on wider screens,
      left-aligned on phones where justification opens wide word gaps ── */
@media (min-width: 900px) {
  .prose-block p,
  .content-section p,
  .article-layout article > p,
  .prose p {
    text-align: justify;
    text-justify: inter-word;
    -webkit-hyphens: auto;
    hyphens: auto;
  }
}

/* ── Logo: never squeezed by the menu (all pages) ── */
.nav-logo { flex-shrink: 0; }
.nav-logo img { height: 64px; width: auto; max-width: none; object-fit: contain; }
/* Same menu spacing as the homepage on every page */
@media (min-width: 1301px) {
  .nav-links { gap: 1.4rem; }
  .nav-links a, .nav-link { font-size: 0.76rem; letter-spacing: 0.04em; }
}

/* ── Links inside Knowledge Centre article text: visible as links ── */
.article-layout article p a,
.article-layout article li a,
.article-layout article blockquote a {
  color: var(--gold-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.article-layout article p a:hover,
.article-layout article li a:hover,
.article-layout article blockquote a:hover { color: var(--gold); }
