/* ==========================================================================
   Equity Legal Group — stylesheet
   Look: letterhead. A brown masthead taken from the logo, ivory pages,
   Caslon headings, thin rules instead of boxes. One file for English (LTR)
   and Arabic (RTL); logical properties handle direction.
   ========================================================================== */

:root {
  --brown: #331510;        /* logo */
  --brown-deep: #261009;
  --gold: #b38742;         /* logo; rules and small marks only */
  --gold-text: #8a6327;    /* gold dark enough for text on ivory */

  --ink: #2a1c16;          /* headings */
  --text: #3e3029;         /* body */
  --muted: #6c5d55;
  --paper: #f8f4ee;
  --white: #ffffff;
  --line: #e2d8cb;
  --line-strong: #cdbfae;

  --on-brown: #f5ede2;
  --on-brown-muted: #cfc0ae;
  --on-brown-line: rgba(245, 237, 226, 0.18);

  --serif: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --display: "Libre Caslon Display", "Libre Caslon Text", Georgia, serif;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;

  --page: 1180px;
  --gutter: clamp(20px, 4vw, 40px);
}

html[lang="ar"] {
  --serif: "Amiri", "Times New Roman", serif;
  --display: "Amiri", "Times New Roman", serif;
  --sans: "IBM Plex Sans Arabic", Tahoma, sans-serif;
}

/* Base -------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  display: flex; flex-direction: column; min-height: 100vh;  /* footer sits at the bottom on short pages */
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 1.0625rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-size: 1.125rem; line-height: 1.9; }

img { display: block; max-width: 100%; height: auto; }
svg { display: block; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
strong { font-weight: 600; color: var(--ink); }

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--gold-text); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 400; text-wrap: balance; }
h1 { font-family: var(--display); font-size: clamp(2.5rem, 5.4vw, 4rem); line-height: 1.08; letter-spacing: -0.01em; }
h2 { font-family: var(--display); font-size: clamp(1.875rem, 3vw, 2.375rem); line-height: 1.15; }
h3 { font-family: var(--serif); font-size: 1.375rem; line-height: 1.3; }
h4 { font-family: var(--sans); font-size: 1rem; font-weight: 600; line-height: 1.45; }
html[lang="ar"] :is(h1, h2, h3) { font-weight: 700; letter-spacing: 0; line-height: 1.45; }
html[lang="ar"] h1 { font-size: clamp(2.25rem, 4.6vw, 3.375rem); line-height: 1.35; }
html[lang="ar"] h2 { font-size: clamp(1.75rem, 2.8vw, 2.125rem); }
html[lang="ar"] h3 { font-size: 1.375rem; }

/* Text in the other script, e.g. an Arabic article on an English page */
html[lang="en"] [lang="ar"] { font-family: "IBM Plex Sans Arabic", Tahoma, sans-serif; }
html[lang="ar"] [lang="en"] { font-family: "IBM Plex Sans", system-ui, sans-serif; }
html[lang="en"] [lang="ar"] :is(h2, h3), html[lang="en"] :is(h2, h3)[lang="ar"] { font-family: "Amiri", serif; font-weight: 700; line-height: 1.5; }
html[lang="ar"] [lang="en"] :is(h2, h3), html[lang="ar"] :is(h2, h3)[lang="en"] { font-family: "Libre Caslon Text", Georgia, serif; font-weight: 400; line-height: 1.3; }

main { flex: 1 0 auto; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.nowrap { white-space: nowrap; }
html[lang="ar"] span[lang="en"], html[lang="en"] span[lang="ar"] { unicode-bidi: isolate; }
html[lang="ar"] span[lang="en"] { direction: ltr; }
html[lang="en"] span[lang="ar"] { direction: rtl; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; inset-inline-start: 16px; top: -60px; z-index: 10;
  padding: 10px 14px; background: var(--white); color: var(--ink);
}
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--page) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

/* Masthead ------------------------------------------------------------------ */
.masthead { background: var(--brown); color: var(--on-brown); }
.masthead a { color: var(--on-brown); text-decoration: none; }
.masthead a:hover { color: var(--white); }
.masthead-bar {
  display: flex; align-items: center; gap: 28px;
  min-height: 92px;
}
.brand { display: flex; align-items: center; gap: 16px; margin-inline-end: auto; }
.brand img { width: 64px; }
.brand-name { font-family: "Libre Caslon Text", Georgia, serif; font-size: 1.375rem; line-height: 1.15; }
html[lang="ar"] .brand-name { font-family: "Amiri", serif; font-weight: 700; font-size: 1.5rem; }
.brand-name small { display: block; font: 400 0.8125rem/1.4 var(--sans); color: var(--on-brown-muted); margin-top: 2px; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav-list { display: flex; gap: 26px; }
.nav-list a { display: block; padding: 6px 0; font-size: 0.9375rem; border-bottom: 1px solid transparent; }
.nav-list a:hover { border-bottom-color: var(--on-brown-muted); }
.nav-list a[aria-current] { border-bottom-color: var(--gold); }
.nav-meta { display: flex; align-items: center; gap: 20px; padding-inline-start: 26px; border-inline-start: 1px solid var(--on-brown-line); font-size: 0.875rem; }
.nav-meta .lang:lang(ar) { font-size: 1rem; }
.nav-meta .lang:lang(en) { font-size: 0.875rem; }

.nav-toggle {
  display: none; width: 44px; height: 44px; padding: 0; place-items: center;
  background: none; border: 1px solid var(--on-brown-line); color: var(--on-brown); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close, .nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 1040px) {
  .masthead { position: relative; }
  .masthead-bar { min-height: 76px; }
  .brand img { width: 54px; }
  .nav-toggle { display: grid; }
  .nav {
    display: none; position: absolute; inset: 100% 0 auto; z-index: 20;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 24px; background: var(--brown);
    border-top: 1px solid var(--on-brown-line);
  }
  .nav.is-open { display: flex; }
  .nav-list { flex-direction: column; gap: 0; }
  .nav-list a { padding: 14px 0; border-bottom: 1px solid var(--on-brown-line); font-size: 1.0625rem; }
  .nav-list a[aria-current] { color: var(--white); border-bottom-color: var(--on-brown-line); }
  .nav-list a[aria-current]::before { content: "· "; color: var(--gold); }
  .nav-meta { padding: 18px 0 0; border: 0; justify-content: space-between; }
}
@media (max-width: 480px) {
  .brand-name { font-size: 1.125rem; }
  .brand-name small { display: none; }
}

/* Home hero (continues the masthead). The photo, toned in the logo's browns,
   fills the far side of the hero up to the edge of the screen. */
.hero {
  --hero-gap: clamp(40px, 6vw, 96px);
  --content: min(100vw - 2 * var(--gutter), var(--page));
  position: relative; overflow: hidden; background: var(--brown); color: var(--on-brown);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--hero-gap); min-height: clamp(480px, 64vh, 640px); align-items: center; }
.hero-text { padding-block: clamp(40px, 6vw, 72px) clamp(56px, 7vw, 96px); }
/* Spans the 5fr column plus the margin beside it, so it meets the screen edge */
.hero-photo { position: absolute; inset-block: 0; inset-inline-end: 0; width: calc((100vw - var(--content)) / 2 + (var(--content) - var(--hero-gap)) * 5 / 12); }
.hero-photo { margin: 0; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
/* Photo credit (required by the licence): small, in the photo's outer corner, tinted to blend in */
.hero-photo figcaption {
  position: absolute; inset-block-end: 12px; inset-inline-end: 16px;
  font-size: 0.6875rem; line-height: 1.3; color: rgba(243, 232, 214, 0.5);
}
.hero-photo figcaption a { color: inherit; text-decoration: none; }
.hero-photo figcaption a:hover { color: var(--on-brown); text-decoration: underline; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-text { padding-bottom: 48px; }
  .hero-photo { position: static; width: auto; max-width: none; margin-inline: calc(-1 * var(--gutter)); }
  .hero-photo { position: relative; }
  .hero-photo img { height: auto; aspect-ratio: 16 / 10; }
}
.hero h1 { color: var(--on-brown); max-width: 16ch; }
html[lang="ar"] .hero h1 { max-width: 20ch; }
.hero-lead { max-width: 60ch; margin-top: 28px; font-size: 1.1875rem; line-height: 1.65; color: var(--on-brown-muted); }
html[lang="ar"] .hero-lead { font-size: 1.25rem; line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 36px; }
.hero-actions a:not(.btn) { color: var(--on-brown); text-decoration-color: var(--gold); }

/* Inner page heading ---------------------------------------------------------- */
.page-head { padding-block: clamp(40px, 6vw, 72px) clamp(28px, 3.5vw, 40px); border-bottom: 1px solid var(--line); }
.page-head h1 { max-width: 20ch; }
.page-head p { max-width: 62ch; margin-top: 20px; font-size: 1.1875rem; color: var(--muted); }
html[lang="ar"] .page-head p { font-size: 1.25rem; }
.page-head .kicker { margin: 0 0 14px; font-size: 0.9375rem; color: var(--gold-text); }

/* Sections: heading in a side column, content beside it ----------------------- */
.band { padding-block: clamp(48px, 7vw, 96px); }
.band + .band { border-top: 1px solid var(--line); }
.band--white { background: var(--white); }
.split {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: 24px clamp(32px, 5vw, 72px);
}
.split > header p { margin-top: 12px; font-size: 0.9375rem; color: var(--muted); }
.split > header a { font-size: 0.9375rem; }
.side-link { margin-top: 18px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.prose { max-width: 66ch; }
.prose h3 { margin: 2em 0 0.5em; }
.prose h3:first-child { margin-top: 0; }
.lead { font-size: 1.1875rem; line-height: 1.65; color: var(--ink); }
html[lang="ar"] .lead { font-size: 1.25rem; line-height: 1.85; }
.muted { color: var(--muted); }
.small { font-size: 0.9375rem; }
.mt { margin-top: 32px; }

/* Buttons --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px;
  font: 500 0.9375rem/1.2 var(--sans); text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--brown); color: var(--on-brown); }
.btn-primary:hover { background: var(--brown-deep); color: var(--white); }
.btn-light { background: var(--on-brown); color: var(--brown); }
.btn-light:hover { background: var(--white); color: var(--brown); }

/* People ---------------------------------------------------------------------- */
.partners { display: grid; grid-template-columns: 1fr 1fr; gap: 40px clamp(32px, 4vw, 56px); }
@media (max-width: 760px) { .partners { grid-template-columns: 1fr; } }
.portrait { width: 132px; aspect-ratio: 4 / 5; object-fit: cover; margin-bottom: 22px; background: var(--line); }
.portrait--profile { width: 168px; margin-bottom: 28px; }
.person h3 { font-size: 1.75rem; }
html[lang="ar"] .person h3 { font-size: 1.625rem; }
.role { margin: 4px 0 16px; font-size: 0.9375rem; color: var(--gold-text); }
.person p { color: var(--text); }
.person .edu { font-size: 0.9375rem; color: var(--muted); }
.person-links { margin-top: 14px; font-size: 0.9375rem; }
.marks { margin: 18px 0; border-top: 1px solid var(--line); }
.marks li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.9375rem; line-height: 1.55; }

/* The other lawyers, listed under the partners on the home page (letterhead style) */
.roster { margin-top: clamp(48px, 6vw, 72px); }
.roster > h3 { margin-bottom: 12px; font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; color: var(--gold-text); }
.roster ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 3vw, 40px); }
.roster li { padding: 18px 0 20px; border-top: 1px solid var(--line); }
.roster li > a { font-family: var(--serif); font-size: 1.25rem; line-height: 1.3; color: var(--ink); text-decoration: none; }
html[lang="ar"] .roster li > a { font-weight: 700; font-size: 1.3125rem; }
.roster li > a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.roster .role { margin: 4px 0 6px; font-size: 0.875rem; }
.roster li p:last-child { font-size: 0.9375rem; line-height: 1.5; color: var(--muted); }
.roster-more { padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.roster-more a { color: var(--muted); text-decoration: none; }
.roster-more a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); }
@media (max-width: 860px) { .roster ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .roster ul { grid-template-columns: 1fr; } }

.people { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(32px, 4vw, 56px); border-top: 1px solid var(--line); }
.people > li { padding: 28px 0; border-bottom: 1px solid var(--line); }
.people h3 { font-size: 1.375rem; }
.people .role { margin-bottom: 10px; }
.people p { font-size: 0.9688rem; }
@media (max-width: 760px) { .people { grid-template-columns: 1fr; } }

/* Lists of work and publications ------------------------------------------------ */
.entries { border-top: 1px solid var(--line); }
.entries > li {
  display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  gap: 6px 32px; padding: 22px 0; border-bottom: 1px solid var(--line);
}
.entries .who { font-size: 0.9375rem; color: var(--gold-text); }
.entries h3 { font-size: 1.25rem; margin-bottom: 6px; }
.entries h3 a { text-decoration: none; }
.entries h3 a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); }
.statement { font-family: var(--serif); font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.55; color: var(--ink); max-width: 40em; }
html[lang="ar"] .statement { font-size: clamp(1.375rem, 2.2vw, 1.625rem); line-height: 1.85; }
.entries p { font-size: 0.9688rem; }
.entries .src { font-size: 0.875rem; color: var(--muted); margin-bottom: 4px; }
@media (max-width: 640px) { .entries > li { grid-template-columns: 1fr; } }

/* Client projects (About page) */
.client { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 8px clamp(32px, 5vw, 72px); padding: 28px 0; border-top: 1px solid var(--line); }
.client h3 { font-size: 1.25rem; }
.client .who { font-size: 0.9375rem; color: var(--muted); }
.client h4 { margin-bottom: 4px; }
.client .matter + .matter { margin-top: 18px; }
.client .matter p { font-size: 0.9688rem; }
.group-title { margin: 56px 0 8px; font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; color: var(--gold-text); }
.group-title:first-child { margin-top: 0; }
@media (max-width: 760px) { .client { grid-template-columns: 1fr; } }

/* Practice areas */
.areas { columns: 2; column-gap: clamp(32px, 4vw, 56px); }
.areas li { break-inside: avoid; padding: 9px 0; border-bottom: 1px solid var(--line); }
.areas a { text-decoration: none; }
.areas a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
@media (max-width: 560px) { .areas { columns: 1; } }
.area-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px clamp(32px, 4vw, 56px); }
.area-cols h3 { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; color: var(--gold-text); margin-bottom: 10px; }
.area-cols .areas { columns: 1; }
@media (max-width: 640px) { .area-cols { grid-template-columns: 1fr; } }

.area { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 6px 40px; padding: 24px 0; border-top: 1px solid var(--line); }
.area h3 { font-size: 1.3125rem; }
.area p { color: var(--text); }
@media (max-width: 700px) { .area { grid-template-columns: 1fr; } }

/* Contact --------------------------------------------------------------------- */
.reach { font-family: var(--display); font-size: clamp(1.75rem, 3.4vw, 2.5rem); line-height: 1.35; }
html[lang="ar"] .reach { font-family: var(--serif); font-weight: 400; }
.reach a { text-decoration: none; }
.reach a:hover { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 1px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 40px; }
.facts h3 { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; color: var(--gold-text); margin-bottom: 8px; }
.facts address { font-style: normal; }
.facts a { text-decoration-color: var(--line-strong); }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr; } }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; max-width: 760px; }
.form .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }
.field label { display: block; margin-bottom: 6px; font-size: 0.9375rem; color: var(--ink); }
.field input, .field textarea {
  width: 100%; padding: 12px 14px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--white); border: 1px solid var(--line-strong); border-radius: 0;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.field [aria-invalid="true"] { border-color: #9b3426; }
.field-error { display: block; min-height: 1.2em; margin-top: 4px; font-size: 0.875rem; color: #9b3426; }
.form-status { margin-top: 16px; padding: 14px 16px; background: var(--white); border-inline-start: 3px solid var(--gold); }
.form-status[hidden] { display: none; }
.note { margin-top: 16px; font-size: 0.875rem; color: var(--muted); }

/* Careers */
.checklist { margin: 12px 0 20px; border-top: 1px solid var(--line); }
.checklist li { padding: 10px 0; border-bottom: 1px solid var(--line); }

/* Footer ---------------------------------------------------------------------- */
.footer { background: var(--brown); color: var(--on-brown-muted); font-size: 0.9375rem; }
.footer a { color: var(--on-brown); text-decoration: none; }
.footer a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.footer-main { display: grid; grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2.5fr)); gap: 36px clamp(28px, 4vw, 56px); padding-block: 64px 48px; }
.footer-brand img { width: 72px; margin-bottom: 18px; }
.footer-brand p { max-width: 34ch; }
.footer h2 { margin-bottom: 12px; font: 600 0.9375rem/1.4 var(--sans); color: var(--on-brown); }
.footer li + li { margin-top: 6px; }
.footer address { font-style: normal; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; padding-block: 20px; border-top: 1px solid var(--on-brown-line); font-size: 0.8125rem; }
@media (max-width: 900px) {
  .footer-main { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) { .footer-main { grid-template-columns: 1fr; } }

@media print {
  .masthead, .nav, .footer { display: none; }
  .hero { background: none; color: #000; }
  .hero h1, .hero-lead { color: #000; }
}
