/* =====================================================================
   A&O Law Firm — shared chrome (header / footer) + helpers
   Page sections keep the design's inline styles; this file styles the
   repeated header & footer, animations, and responsive behaviour.
   ===================================================================== */

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Tajawal', sans-serif; }
img { max-width: 100%; }

@keyframes heroIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes kenburns { from { transform: scale(1.18); } to { transform: scale(1); } }

/* ----------------------------- Header ------------------------------ */
.site-header { font-family: 'Tajawal', sans-serif; position: relative; z-index: 50; }

.topbar { background: #182515; color: #d8c8a8; font-size: 13.5px; }
.topbar__inner {
  max-width: 1280px; margin: 0 auto; padding: 9px 28px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.topbar__loc { display: flex; align-items: center; gap: 9px; }
.topbar__loc svg { flex-shrink: 0; }
.topbar__links { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.topbar a { color: #d8c8a8; text-decoration: none; display: flex; align-items: center; gap: 7px; transition: color .2s; }
.topbar a:hover { color: #BC945C; }
.topbar .ic { color: #BC945C; }
.topbar__phone b { font-weight: 700; color: #fff; letter-spacing: .5px; }
.topbar__lang { background: #BC945C; color: #182515 !important; font-weight: 700; padding: 4px 14px; border-radius: 2px; font-size: 12.5px; }
.topbar__lang:hover { background: #a37d45; color: #fff !important; }

.navbar { position: sticky; top: 0; z-index: 50; background: rgba(253,251,247,0.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(188,148,92,0.28); box-shadow: 0 4px 24px rgba(24,37,21,0.06); }
.navbar__inner { max-width: 1280px; margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.navbar__logo { display: flex; align-items: center; flex-shrink: 0; }
.navbar__logo img { height: 62px; width: auto; display: block; }

.mainnav { display: flex; align-items: center; gap: 6px; }
.mainnav a { font-weight: 700; font-size: 15.5px; color: #182515; text-decoration: none; padding: 10px 16px; border-radius: 2px; transition: color .2s; white-space: nowrap; }
.mainnav a:hover { color: #BC945C; }
.mainnav a.is-active { color: #9c7636; border-bottom: 2px solid #BC945C; }

.navcta { flex-shrink: 0; display: inline-flex; align-items: center; gap: 9px; background: linear-gradient(135deg,#BC945C,#a37d45); color: #fff; font-weight: 700; font-size: 15px; padding: 12px 24px; border-radius: 2px; text-decoration: none; box-shadow: 0 6px 18px rgba(188,148,92,0.32); transition: transform .2s, box-shadow .2s; }
.navcta:hover { background: linear-gradient(135deg,#c9a065,#b08a4f); box-shadow: 0 10px 26px rgba(188,148,92,0.45); transform: translateY(-1px); }

.navtoggle { display: none; width: 46px; height: 42px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; background: transparent; border: 1px solid rgba(188,148,92,0.5); border-radius: 4px; cursor: pointer; padding: 0; }
.navtoggle span { display: block; width: 22px; height: 2px; background: #182515; transition: transform .25s, opacity .25s; }
.navbar.is-open .navtoggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar.is-open .navtoggle span:nth-child(2) { opacity: 0; }
.navbar.is-open .navtoggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ----------------------------- Footer ------------------------------ */
.site-footer { font-family: 'Tajawal', sans-serif; background: #142010; color: #cbbfa6; position: relative; overflow: hidden; }
.site-footer__dots { position: absolute; inset: 0; background-image: radial-gradient(circle at 1px 1px, rgba(188,148,92,0.12) 1px, transparent 0); background-size: 26px 26px; opacity: .5; pointer-events: none; }
.site-footer__ring { position: absolute; top: -90px; width: 280px; height: 280px; border: 1px solid rgba(188,148,92,0.16); border-radius: 50%; pointer-events: none; }
.footer__inner { position: relative; max-width: 1280px; margin: 0 auto; padding: 68px 28px 0; }
.footer__top { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 48px; padding-bottom: 52px; border-bottom: 1px solid rgba(188,148,92,0.18); }
.footer__brand img { height: 84px; width: auto; display: block; margin-bottom: 22px; }
.footer__brand p { line-height: 2; font-size: 15px; color: #b8ac92; max-width: 380px; margin: 0; }
.footer__accred { display: inline-flex; align-items: center; gap: 9px; margin-top: 22px; color: #BC945C; text-decoration: none; font-size: 14px; font-weight: 600; border: 1px solid rgba(188,148,92,0.4); padding: 9px 16px; border-radius: 2px; }
.footer__accred:hover { background: rgba(188,148,92,0.1); }
.site-footer h4 { font-family: 'Amiri', serif; color: #fff; font-size: 21px; margin: 0 0 22px; font-weight: 700; }
.footer__links, .footer__contact { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.footer__links { gap: 14px; }
.footer__contact { gap: 18px; }
.footer__links a { color: #cbbfa6; text-decoration: none; font-size: 15px; display: inline-flex; align-items: center; gap: 9px; transition: color .2s; }
.footer__links a:hover { color: #BC945C; }
.footer__links .chev { color: #BC945C; }
.footer__contact li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.7; }
.footer__contact li.center { align-items: center; }
.footer__contact svg { flex-shrink: 0; margin-top: 1px; }
.footer__contact .ic { color: #BC945C; font-size: 17px; flex-shrink: 0; }
.footer__contact a { color: #cbbfa6; text-decoration: none; transition: color .2s; }
.footer__contact a:hover { color: #BC945C; }
.footer__wa { display: inline-flex; align-items: center; gap: 9px; background: rgba(188,148,92,0.12); border: 1px solid rgba(188,148,92,0.4); color: #e6dcc6 !important; font-weight: 600; padding: 10px 18px; border-radius: 2px; }
.footer__wa:hover { background: rgba(188,148,92,0.22); border-color: rgba(188,148,92,0.6); color: #fff !important; }
.footer__bottom { display: flex; align-items: center; justify-content: space-between; padding: 24px 0; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: #8f856e; }
.footer__mark { color: #BC945C; letter-spacing: 1px; }

/* Direction-aware footer ring corner */
[dir="rtl"] .site-footer__ring { left: -90px; }
[dir="ltr"] .site-footer__ring { right: -90px; }

/* Logo shown on dark backgrounds — render the brand mark in warm white */
.logo-on-dark { filter: brightness(0) invert(1); opacity: .95; }

/* Portrait placeholder (used where real headshots are not yet supplied) */
.portrait { width: 100%; height: 100%; min-height: inherit; background: linear-gradient(160deg,#20301a,#141f10); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.portrait::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle at 1px 1px, rgba(188,148,92,0.10) 1px, transparent 0); background-size: 20px 20px; }
.portrait svg { width: 44%; max-width: 140px; height: auto; position: relative; color: rgba(188,148,92,0.55); }

/* --------------------------- WhatsApp FAB -------------------------- */
.wa-float { position: fixed; bottom: 24px; z-index: 60; width: 58px; height: 58px; border-radius: 50%; background: #25D366; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 30px rgba(0,0,0,0.28); transition: transform .2s, box-shadow .2s; }
.wa-float:hover { transform: translateY(-3px); box-shadow: 0 18px 38px rgba(0,0,0,0.35); }
[dir="rtl"] .wa-float { left: 24px; }
[dir="ltr"] .wa-float { right: 24px; }

/* --------------------------- Responsive ---------------------------- */
@media (max-width: 860px) {
  .navtoggle { display: flex; }
  .mainnav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #fdfbf7; border-bottom: 1px solid rgba(188,148,92,0.28);
    box-shadow: 0 18px 30px rgba(24,37,21,0.12); padding: 8px; display: none;
  }
  .navbar.is-open .mainnav { display: flex; }
  .mainnav a { padding: 14px 18px; font-size: 16.5px; }
  .mainnav a.is-active { border-bottom: none; background: rgba(188,148,92,0.12); }
  .navcta { padding: 11px 18px; font-size: 14px; }
}
@media (max-width: 620px) {
  .topbar__loc span { display: none; }
  .topbar__phone span:not(.ic) { display: none; }
  .navcta span:first-child { display: inline; }
}

/* Grids tagged .rgrid* collapse responsively */
@media (max-width: 900px) {
  .rgrid   { grid-template-columns: 1fr !important; }
  .rgrid-3 { grid-template-columns: 1fr !important; }
}
@media (max-width: 1000px) {
  .rgrid-4 { grid-template-columns: repeat(2,1fr) !important; }
}
@media (max-width: 620px) {
  .rgrid-2 { grid-template-columns: 1fr !important; }
  .rgrid-4 { grid-template-columns: 1fr !important; }
  .footer__top { grid-template-columns: 1fr !important; gap: 36px !important; }
}
@media (max-width: 820px) {
  .footer__top { grid-template-columns: 1fr 1fr; }
}

/* Team-page founding-partner card: stack image over text on small screens */
@media (max-width: 560px) {
  .partner-grid { grid-template-columns: 1fr !important; }
  .partner-grid .partner-photo { min-height: 320px !important; }
}

/* About-page timeline: collapse the alternating layout on small screens */
@media (max-width: 860px) {
  .tl-line { display: none !important; }
  .tl-row { grid-template-columns: 1fr !important; gap: 22px !important; }
  .tl-row .tl-card { grid-column: 1 !important; order: 1 !important; }
  .tl-row .tl-dot { grid-column: 1 !important; order: 0 !important; flex-direction: row !important; justify-self: start !important; }
}

/* Fluid down-scaling for the biggest headings (override inline sizes) */
@media (max-width: 720px) {
  .hero-title { font-size: 44px !important; line-height: 1.3 !important; }
  .page-title { font-size: 42px !important; }
  .sec-title  { font-size: 36px !important; line-height: 1.3 !important; }
}
@media (max-width: 460px) {
  .hero-title { font-size: 34px !important; }
  .page-title { font-size: 34px !important; }
  .sec-title  { font-size: 30px !important; }
}

/* ============================================================
   MOBILE — the page bodies use inline styles, so these rules
   use attribute selectors + !important to tame them on phones.
   ============================================================ */

/* Header must fit: shrink brand, drop the desktop CTA (menu has Contact) */
@media (max-width: 860px) {
  .navbar__logo img { height: 46px; }
  .navcta { display: none; }
  .navbar__inner { padding: 12px 16px; }
  .topbar__inner { padding: 8px 16px; }
}

/* Collapse every wide auto-fit grid so nothing exceeds the viewport width */
@media (max-width: 920px) {
  [style*="minmax(480px"], [style*="minmax(420px"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 780px) {
  [style*="minmax(380px"], [style*="minmax(320px"],
  [style*="minmax(300px"], [style*="minmax(280px"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 620px) {
  [style*="minmax(240px"], [style*="minmax(200px"] { grid-template-columns: 1fr !important; }
}

/* Cap the "on dark" logos (hero est-row logo is 110px tall → too wide on phones) */
@media (max-width: 600px) {
  .logo-on-dark { height: auto !important; max-height: 58px; width: auto; }
}

/* Scale down the large inline heading sizes on phones */
@media (max-width: 600px) {
  [style*="font-size:82px"], [style*="font-size:74px"], [style*="font-size:72px"],
  [style*="font-size:70px"] { font-size: 33px !important; line-height: 1.3 !important; }

  [style*="font-size:64px"], [style*="font-size:62px"], [style*="font-size:60px"],
  [style*="font-size:58px"], [style*="font-size:56px"], [style*="font-size:54px"]
    { font-size: 29px !important; line-height: 1.35 !important; }

  [style*="font-size:50px"], [style*="font-size:48px"], [style*="font-size:46px"],
  [style*="font-size:44px"], [style*="font-size:42px"], [style*="font-size:40px"],
  [style*="font-size:38px"], [style*="font-size:37px"], [style*="font-size:36px"]
    { font-size: 25px !important; line-height: 1.4 !important; }

  [style*="font-size:34px"], [style*="font-size:33px"], [style*="font-size:32px"],
  [style*="font-size:31px"], [style*="font-size:30px"], [style*="font-size:29px"]
    { font-size: 22px !important; line-height: 1.45 !important; }

  [style*="font-size:28px"], [style*="font-size:27px"], [style*="font-size:26px"]
    { font-size: 20px !important; line-height: 1.6 !important; }

  [style*="font-size:25px"], [style*="font-size:24px"], [style*="font-size:23px"],
  [style*="font-size:22px"], [style*="font-size:21px"] { font-size: 17.5px !important; }

  [style*="font-size:20px"], [style*="font-size:19px"], [style*="font-size:18.5px"]
    { font-size: 16px !important; }
}

/* Tighten oversized section / card padding on phones */
@media (max-width: 600px) {
  [style*="padding:120px 28px 200px"] { padding: 84px 18px 108px !important; }
  [style*="padding:110px 28px"] { padding: 56px 18px !important; }
  [style*="padding:120px 28px"] { padding: 56px 18px !important; }
  [style*="padding:100px 28px"] { padding: 52px 18px !important; }
  [style*="padding:96px 28px"]  { padding: 50px 18px !important; }
  [style*="padding:90px 28px"]  { padding: 48px 18px !important; }
  [style*="padding:88px 28px"]  { padding: 48px 18px !important; }
  [style*="padding:84px 28px 70px"] { padding: 46px 18px 40px !important; }
  [style*="padding:80px 28px"]  { padding: 46px 18px !important; }
  [style*="padding:76px 28px"]  { padding: 44px 18px !important; }
  [style*="padding:56px 44px"]  { padding: 36px 22px !important; }
  [style*="padding:50px 44px"]  { padding: 32px 22px !important; }
  [style*="padding:46px 44px"]  { padding: 30px 20px !important; }
  [style*="padding:44px 38px 40px"] { padding: 30px 22px !important; }
  [style*="padding:52px 48px"]  { padding: 32px 22px !important; }
  [style*="padding:64px 46px 56px"] { padding: 42px 22px !important; }
  [style*="padding:40px 42px"]  { padding: 28px 20px !important; }
  [style*="padding:38px 40px"]  { padding: 26px 20px !important; }
  [style*="padding:34px 30px"]  { padding: 26px 20px !important; }
}

/* Hero / page-hero sections use display:flex to center content vertically;
   on phones that stops the content from shrinking and overflows the width.
   Switch them to block so children wrap within the viewport. */
@media (max-width: 860px) {
  [style*="min-height:92vh"],
  [style*="min-height:480px"],
  [style*="min-height:420px"],
  [style*="min-height:380px"] { display: block !important; }
  /* let inline flex rows wrap instead of forcing width */
  [style*="display:flex"] { min-width: 0; }
}

/* Never allow a horizontal scrollbar */
html, body { max-width: 100%; overflow-x: hidden; }
img, iframe { max-width: 100%; }

/* On phones, keep the desktop-style cinematic hero (headline overlaid on a
   darkened image), but show the FULL founders image (contain) instead of a
   cropped cover. Dark-green fills the area around the image; a lighter overlay
   keeps the faces visible while the text stays readable via its text-shadow. */
@media (max-width: 700px) {
  [style*="min-height:92vh"] { display: flex !important; min-height: 86vh !important; }
  #heroImg {
    object-fit: contain !important;
    object-position: center !important;
    background: #182515;
    animation: none !important;
  }
  #heroImg + div { background: linear-gradient(180deg, rgba(24,37,21,0.32), rgba(20,32,16,0.72)) !important; }
  #heroImg ~ div[style*="padding:120px 28px 200px"] { padding: 48px 20px !important; }
}
