/* Prevent flash before i18n + full load (images/background) */
html:not(.i18n-ready) body,
html:not(.page-ready) body{
  visibility: hidden;
}

:root{
  --bg: #f6f2e9;
  --bg2: #fbf8f2;

  --text: #0b1020;
  --muted: rgba(11,16,32,.70);

  --orange: #ff8c00;

  --line: rgba(11,16,32,.15);
  --panel: rgba(11,16,32,.04);

  --radius: 16px;
  --header-bg: rgba(251,248,242,.92);
}

*{ box-sizing: border-box; }

/* Keep html scroll behavior consistent, but DO NOT lock body height */
html{ margin:0; padding:0; height: 100%; overflow-y: scroll; }

/* Sticky footer ONLY for pages that use <main class="page"> */
body:has(main.page){
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body:has(main.page) main.page{ flex: 1 0 auto; }

body{
  margin: 0;
  padding: 0;
  overflow-x: hidden;

  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(1100px 520px at 18% -10%, rgba(255,140,0,.18), transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg));
  color: var(--text);
  line-height: 1.5;
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }

.container{
  width: min(1100px, 92%);
  margin: 0 auto;
}

/* ================= HEADER ================= */

.site-header{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 50;

  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--line);

  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.header-inner{
  display:flex;
  justify-content: space-between;
  align-items:center;
  padding: 10px 0;
  gap: 22px;
}

.brand{
  display:flex;
  gap:14px;
  align-items:center;
}
.brand:hover{ text-decoration: none; }

.logo{
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
}
.logo img{
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Default nav (if used on non-grid pages) */
.nav{
  display:flex;
  gap: 26px;
  align-items:center;
  justify-content:center;
  flex: 1;
  min-width: 0;
}
.nav a{
  font-size: 16px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.controls{
  display:flex;
  gap:10px;
  align-items:center;
  flex: 0 0 auto;
}

/* ================= BUTTONS ================= */

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(11,16,32,.04);
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.btn.primary{
  background: rgba(255,140,0,.18);
  border-color: rgba(255,140,0,.5);
}

.btn.ghost{
  background: rgba(11,16,32,.05);
}

.link{
  display:inline-block;
  margin-top: 10px;
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: rgba(11,16,32,.25);
  text-underline-offset: 3px;
}
.link:hover{ text-decoration-color: rgba(11,16,32,.55); }

/* ================= PAGE ================= */

.page{ padding: 132px 0 0; }

.page-header{
  padding: 22px 0 10px;
}

.page-header h1{
  margin: 0 0 8px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.15;
}

.lead{ color: var(--muted); max-width: 70ch; margin: 0; }

/* ================= CARDS ================= */

.card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

/* ================= INSIGHTS LAYOUT ================= */

.insights-top{
  display:grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  align-items: stretch;
  margin-top: 18px;
  min-height: 560px;
}

.insight-featured{
  overflow: hidden;
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.featured-image{
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(11,16,32,.08);
  border-bottom: 1px solid var(--line);
}

.featured-body{
  padding: 18px;
  flex: 1;
}

.featured-title{
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.2;
}

.featured-subtitle{
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.featured-preview{
  margin: 0 0 14px;
  color: var(--muted);
}

/* Right side: 3 equal rows */
.insight-side{
  height: 100%;
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 12px;
}

.insight-compact{
  padding: 14px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
}

.compact-body{ flex: 1; min-width: 0; }

.compact-media{
  flex: 0 0 110px;
  width: 110px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(11,16,32,.10), rgba(11,16,32,.04));
}

.compact-title{ margin: 0 0 6px; font-size: 16px; line-height: 1.25; }
.compact-subtitle{ margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.compact-preview{ margin: 0; font-size: 13px; color: var(--muted); }

/* Archive */
.insights-archive{
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.section-title{ margin: 0 0 14px; font-size: 18px; }

.archive-list{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.archive-item{
  padding: 16px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
}

.archive-body{ flex: 1; min-width: 0; }

.archive-media{
  flex: 0 0 110px;
  width: 110px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(11,16,32,.10), rgba(11,16,32,.04));
}

.archive-title{ margin: 0 0 6px; font-size: 15px; line-height: 1.25; }
.archive-subtitle{ margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.archive-preview{ margin: 0; font-size: 13px; color: var(--muted); }

.is-hidden{ display: none; }

.archive-actions{
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* ================= FOOTER ================= */

.footer{
  border-top: 2px solid var(--line);
  padding: 22px 0;
  margin-top: 42px;
}

.footer-inner{
  display:flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.small{ color: var(--muted); font-size: 13px; }

.footer-left{
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-contact{
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-contact .label{ font-size: 13px; color: var(--muted); }

.footer-icon{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(11,16,32,.03);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.footer-icon img{
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}

/* ================= LANGUAGE DROPDOWN ================= */

.lang-select{ position: relative; z-index: 100; }

.lang-current{
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lang-current img{
  width: 22px;
  height: 22px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.lang-current span{ font-size: 14px; line-height: 1; }

.lang-menu{
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 120;
  display: flex;
  gap: 6px;
}

.lang-select.open .lang-menu{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.lang-menu button{
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 8px;
}

.lang-menu button:hover{ background: rgba(11,16,32,.06); }

.lang-menu img{
  width: 22px;
  height: 22px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

/* ================= ACCESSIBILITY ================= */

.brand:focus-visible{
  outline: 2px solid rgba(255,140,0,.55);
  outline-offset: 4px;
  border-radius: 12px;
}

.lang-current:focus-visible{
  outline: 2px solid rgba(255,140,0,.55);
  outline-offset: 2px;
}

/* ================= HEADER GRID (6 RECTANGLES) ================= */

.header-squares{
  display: grid;
  grid-template-columns: 112px 1fr 1fr 1fr 1fr 190px;
  align-items: stretch;
  gap: 0;
  padding: 0;
}

.header-squares .brand{
  grid-column: 1;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  margin: 0;
}

.header-squares .nav-squares{
  grid-column: 2 / 6;
  display: contents;
}

.header-squares .nav-squares .nav-cell{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 10px;
  height: 100%;
  background: transparent;
  border-radius: 0;
  text-decoration: none;

  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.02em;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-squares .nav-squares .nav-cell.mid:hover{
  background: rgba(255,255,255,.40);
  text-decoration: none;
}

.header-squares .controls{
  grid-column: 6;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: stretch;
  padding: 10px 14px;
}

.header-squares .lang-select{
  width: 100%;
  display: flex;
}

.header-squares .lang-current{
  height: 40px;
  width: 100%;
  justify-content: center;
  overflow: hidden;
}

.header-squares .lang-current span{
  max-width: 100%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ================= FIXED PAGE BACKGROUND LAYER =================
   Keep using the same element (.insights-bg) across pages.
   Only the page wrapper class decides which image is used. */

.insights-bg{
  position: fixed;
  inset: 0;
  z-index: -1;
  background: center / cover no-repeat;
}

.insights-layer .insights-bg{ background-image: url("assets/bg1.jpg"); }
.risk-layer .insights-bg{ background-image: url("assets/bg4.jpg"); }
.risk-analytics-layer .insights-bg{ background-image: url("assets/bg5.jpg"); }
.the-firm-layer .insights-bg{ background-image: url("assets/bg2.jpg"); }

/* On Insights: ALL boxes must be filled (no bleed-through) */
.insights-layer .card,
.insights-layer .page-header{
  background: rgba(251,248,242, .98);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.insights-layer .page-header{
  padding: 18px;
  margin-bottom: 18px; /* space before first box */
}

/* The Firm: add space between stacked cards */
.the-firm-layer .firm-row + .firm-row{
  margin-top: 18px;
}

/* Footer should be filled on any page using the boxed layout */
main.insights-layer + .footer{
  background: rgba(251,248,242, .98);
}

/* Divider line above the archive section */
.insights-layer .insights-archive{
  border-top: 1px solid rgba(255,255,255,.75);
}

/* "All insights" heading */
.insights-layer .section-title{
  color: #ffffff;
}

/* Show more / Show less buttons */
.insights-layer .archive-actions .btn{
  color: #ffffff;
  border-color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.10);
}

.insights-layer .archive-actions .btn:hover{
  background: rgba(255,255,255,.18);
}

/* Insights: add breathing room below the Show more/less buttons */
.insights-layer .archive-actions{
  margin-bottom: 28px;
}

/* ================= THE FIRM ================= */

/* 3 aligned rectangles: left title+media, right text */
.firm-row{
  display: grid;

  /* wider left column so email fits cleanly */
  grid-template-columns: 300px 1fr;

  /* more separation so the right text starts further right */
  column-gap: 24px;

  align-items: stretch;
}

/* Left column: title on top, media under it */
.firm-left{
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;

  /* adapt to the right/text height (text is the limiter) */
  justify-content: center;
}

/* Same visual title style for h1 and h2 inside left column */
.firm-left-title{
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.15;

  text-align: center;
}

/* Make the media block occupy the remaining height so it “matches” the text box height */
.firm-left-media{
  flex: 1;
  display: flex;

  /* center media (logo / george / email) */
  align-items: center;
  justify-content: center;
}

/* Right column text */
.firm-right{
  min-width: 0;
}

.firm-right-text{
  margin: 0 0 14px 0;   /* space between paragraphs */
  text-align: justify;
}

/* George bio text */
.firm-bio{
  text-align: justify;
}
.firm-bio p{
  margin: 0 0 10px;
  max-width: none;
}

/* Logo circle: EXACT same size as George circle */
.firm-logo-circle{
  width: 180px;
  height: 180px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;

  background: rgba(255,255,255,.95);
  border: 1px solid var(--line);

  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.firm-logo-circle img{
  width: 80%;
  height: 80%;
  object-fit: contain;
  display: block;
}

/* George photo circle */
.firm-photo{
  width: 180px;
  height: 180px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(251,248,242,.98);
  flex: 0 0 auto;
}

.firm-photo img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Email “button” treated like the left media */
.firm-email-btn{
  --mail-size: 22px;

  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 0;
  border: none;
  background: none;
  text-decoration: none;
  font-weight: 650;
  white-space: nowrap;

  max-width: 100%;
  overflow: hidden;
}

.firm-email-btn:hover{
  text-decoration: underline;
}

.firm-email-btn img{
  width: var(--mail-size);
  height: var(--mail-size);
  display: block;
  object-fit: contain;
}

.firm-email-btn span{
  display: block;
  line-height: var(--mail-size);

  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 900px){
  .nav{ display:none; }
  .insights-top{ grid-template-columns: 1fr; min-height: auto; }
  .archive-list{ grid-template-columns: 1fr; }

  .firm-row{
    grid-template-columns: 1fr;
  }

  .firm-left-media{
    flex: 0 0 auto;
  }

  .firm-profile-grid{
    grid-template-columns: 1fr;
  }

  .firm-recruit-grid{
    grid-template-columns: 1fr;
  }

  .firm-about{
    grid-template-columns: 1fr;
  }

  .firm-logo{
    justify-content: flex-start;
  }

  .firm-profile{
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .firm-bio{
    text-align: left;
  }

  .firm-recruit{
    flex-direction: column;
    align-items: flex-start;
  }

  .firm-email{
    width: 100%;
    justify-content: center;
  }
}