/* Shared styles for the draft of the new batinalard.com (index.html = English, ar.html = Arabic with rtl.css on top). */
  /* Draft of the new batinalard.com. Every fact on this page is from research/facts.md (the current official site).
     Images: site/images/<slot>.jpg, made by scripts/site_images.py. field-5.jpg (the camp) does not exist yet. */
  @font-face { font-family: Playfair; font-weight: 700; font-display: swap; src: url(fonts/playfair-display-latin-700-normal.woff2); }
  @font-face { font-family: Mont; font-weight: 400 500; font-display: swap; src: url(fonts/montserrat-latin-400-normal.woff2); }
  @font-face { font-family: Mont; font-weight: 600 700; font-display: swap; src: url(fonts/montserrat-latin-600-normal.woff2); }
  @font-face { font-family: PlexAr; font-weight: 400 500; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
  @font-face { font-family: PlexAr; font-weight: 600 700; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
  @font-face { font-family: Mono; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2); }
  :root { --deep: #1C1410; --brown: #2B1A10; --ink: #2A1A10; --gold: #C8963C; --gold2: #E6C272; --goldtxt: #876118; --goldbig: #9A6F1E; --cream: #F8F4EC; --sand: #EFE7D8; --line: #E0D4BE; --soft: #6B5A4C; --max: 1180px; }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body { font-family: Mont, Arial, sans-serif; color: var(--ink); background: var(--cream); line-height: 1.65; font-size: 17px; -webkit-font-smoothing: antialiased; }
  img { max-width: 100%; height: auto; display: block; }
  a { color: inherit; text-decoration: none; }
  .wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 28px; }
  section { padding: 96px 0; }
  .eyebrow { font-family: Mono, monospace; font-size: 13px; letter-spacing: 2.6px; text-transform: uppercase; color: var(--goldtxt); margin-bottom: 14px; }
  h1, h2 { font-family: Playfair, Georgia, serif; font-weight: 700; line-height: 1.12; letter-spacing: -.3px; }
  h2 { font-size: clamp(32px, 4vw, 46px); margin-bottom: 22px; }
  h3 { font-size: 20px; font-weight: 700; line-height: 1.3; }
  p.lead { font-size: 19px; color: #3D2B1F; max-width: 62ch; }
  .gold { background: linear-gradient(90deg, #B5822A, #F0C864 55%, #C8963C); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .rule { width: 76px; height: 4px; background: linear-gradient(90deg, #AE7723, #FFD86E); margin: 0 0 26px; }

  /* nav */
  header.nav { position: fixed; inset: 0 0 auto 0; z-index: 20; transition: background .25s, box-shadow .25s; }
  header.nav.solid { background: rgba(28,20,16,.96); box-shadow: 0 1px 0 rgba(230,194,114,.25); }
  .nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; }
  .nav img { height: 38px; width: auto; }
  .nav nav { display: flex; gap: 30px; }
  .nav nav a { color: var(--cream); font-size: 14.5px; font-weight: 500; letter-spacing: .3px; opacity: .9; }
  .nav nav a:hover { color: var(--gold2); opacity: 1; }
  .nav .right { display: flex; align-items: center; gap: 30px; }
  .lang { color: var(--cream); font-size: 14px; font-weight: 600; border: 1px solid rgba(248,244,236,.5); border-radius: 3px; padding: 6px 13px; line-height: 1.3; }
  .lang[lang=ar] { font-family: PlexAr, sans-serif; }
  .lang:hover { border-color: var(--gold2); color: var(--gold2); }

  /* hero */
  .hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; color: var(--cream); background: var(--deep) url(images/project-nabitah.webp) center 38% / cover no-repeat; padding: 0; }
  .hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(20,13,8,.72) 0%, rgba(20,13,8,.28) 38%, rgba(20,13,8,.82) 100%); }
  .hero .wrap { position: relative; padding-top: 150px; padding-bottom: 64px; }
  .hero h1 { font-size: clamp(46px, 8vw, 104px); margin-bottom: 22px; }
  .hero p { font-size: clamp(18px, 2.2vw, 25px); font-weight: 500; max-width: 26em; color: #F1E9DA; }
  .hero .cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
  .btn { display: inline-block; padding: 14px 26px; font-weight: 600; font-size: 15px; letter-spacing: .3px; border-radius: 3px; }
  .btn.pri { background: linear-gradient(90deg, #C8963C, #E9C068); color: #1C1410; }
  .btn.sec { border: 1.5px solid rgba(248,244,236,.6); color: var(--cream); }
  .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 56px; border-top: 1px solid rgba(230,194,114,.4); }
  .facts div { padding: 20px 22px 0 0; }
  .facts b { display: block; font-family: Playfair, serif; font-size: clamp(26px, 3vw, 36px); color: var(--gold2); line-height: 1.2; }
  .facts span { font-size: 14.5px; color: #E2D8C6; }

  /* about */
  .about .grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: center; }
  .about p + p { margin-top: 16px; }
  .collage { display: grid; grid-template-columns: 1.25fr 1fr; grid-template-rows: 1fr 1fr; gap: 14px; }
  .collage img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
  .collage img:first-child { grid-row: 1 / 3; }
  .mission { margin-top: 26px; padding: 18px 22px; border-left: 4px solid var(--gold); background: var(--sand); font-weight: 500; }
  .mission small { display: block; font-family: Mono, monospace; font-size: 12px; letter-spacing: 2.2px; color: var(--goldtxt); margin-bottom: 6px; }

  /* approach */
  .approach { background: var(--deep); color: var(--cream); }
  .approach .eyebrow { color: var(--gold2); }
  .approach p.lead { color: #E2D8C6; }
  .steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 46px; border-top: 1px solid rgba(230,194,114,.35); }
  .steps div { padding: 26px 26px 6px 0; border-right: 1px solid rgba(230,194,114,.18); }
  .steps div + div { padding-left: 26px; }
  .steps div:last-child { border-right: 0; }
  .steps i { font-style: normal; font-family: Mono, monospace; font-size: 13px; letter-spacing: 2px; color: var(--gold2); }
  .steps h3 { margin: 8px 0 8px; color: #fff; }
  .steps p { font-size: 15.5px; color: #D6CAB4; }

  /* projects */
  .feature { display: grid; grid-template-columns: 1.15fr .85fr; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-top: 40px; }
  .feature .pics { display: grid; grid-template-rows: 1.25fr 1fr; gap: 0; }
  .feature .pics img { width: 100%; height: 100%; object-fit: cover; }
  .feature .txt { padding: 38px 38px 34px; }
  .tag { display: inline-block; font-family: Mono, monospace; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: #1C1410; background: var(--gold2); padding: 4px 10px; border-radius: 2px; margin-bottom: 14px; }
  .feature h3 { font-family: Playfair, serif; font-size: 30px; margin-bottom: 4px; }
  .feature .sub { color: var(--soft); font-weight: 500; margin-bottom: 18px; }
  dl { display: grid; grid-template-columns: auto 1fr; gap: 9px 20px; font-size: 15.5px; }
  dt { color: var(--soft); } dd { font-weight: 600; }
  .feature p { margin-top: 18px; font-size: 15.5px; color: #4A3829; }
  table.proj { width: 100%; border-collapse: collapse; margin-top: 44px; font-size: 16px; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
  .proj th { text-align: left; font-family: Mono, monospace; font-weight: 500; font-size: 12.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--cream); background: var(--brown); padding: 14px 20px; }
  .proj td { padding: 15px 20px; border-top: 1px solid var(--line); }
  .proj td:first-child { font-weight: 600; }
  .proj td small { color: var(--soft); font-weight: 400; font-size: 14px; }
  .proj .now td:last-child { color: var(--goldtxt); font-weight: 700; }
  .scroll { overflow-x: auto; }

  /* interactive 3D view of ND40 (v3d.js) */
  .v3d { position: relative; margin-top: 44px; height: clamp(340px, 50vw, 600px); border-radius: 6px; overflow: hidden; background: radial-gradient(ellipse at 50% 38%, #33200F 0%, #140D08 72%); perspective: 1500px; perspective-origin: 50% 30%; touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none; color: var(--cream); }
  .v3d.grab { cursor: grabbing; }
  .v3d:focus-visible { outline: 2px solid var(--gold2); outline-offset: 3px; }
  .v3d .plane { position: absolute; left: 50%; top: 57%; width: 1400px; height: 1400px; transform-style: preserve-3d; transform: translate(-50%, -50%) scale(var(--s, .5)) rotateX(var(--rx, 58deg)) rotateZ(var(--rz, -24deg)); will-change: transform; }
  .v3d .plane > * { position: absolute; left: 0; top: 0; width: 1400px; height: 1400px; max-width: none; pointer-events: none; }
  .v3d .plane img { -webkit-mask-image: radial-gradient(closest-side, #000 70%, transparent 100%); mask-image: radial-gradient(closest-side, #000 70%, transparent 100%); }
  .v3d .hud { position: absolute; inset-inline-start: 24px; top: 20px; pointer-events: none; text-shadow: 0 1px 8px rgba(0,0,0,.8); }
  .v3d .hud small { display: block; font-family: Mono, monospace; font-size: 12.5px; letter-spacing: 2.4px; text-transform: uppercase; color: var(--gold2); }
  .v3d .hud b { display: block; font-family: Playfair, Georgia, serif; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.25; margin-top: 4px; }
  .v3d .hud span { font-size: 15px; color: #E2D8C6; }
  .v3d .hint { position: absolute; inset-inline-start: 24px; bottom: 16px; display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; pointer-events: none; transition: opacity .6s; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
  .v3d .hint::before { content: ''; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--gold2); background: radial-gradient(circle, var(--gold2) 0 4px, transparent 5px); }
  .v3d.used .hint { opacity: 0; }
  .v3d .credit { position: absolute; inset-inline-end: 20px; bottom: 16px; font-size: 12.5px; color: rgba(226,216,198,.85); pointer-events: none; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
  @media (max-width: 600px) { .v3d .credit { inset-inline-end: auto; inset-inline-start: 24px; bottom: 50px; } }

  /* timeline */
  .time { background: var(--sand); }
  .tl { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; margin-top: 46px; position: relative; }
  .tl::before { content: ''; position: absolute; left: 0; right: 0; top: 8px; height: 2px; background: var(--gold); }
  .tl div { position: relative; padding: 30px 18px 0 0; }
  .tl div::before { content: ''; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(200,150,60,.22); }
  .tl b { display: block; font-family: Playfair, serif; font-size: 21px; color: var(--goldtxt); line-height: 1.25; }
  .tl span { font-size: 15px; }

  /* field */
  .gal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 40px; }
  .gal figure { position: relative; overflow: hidden; border-radius: 4px; background: var(--deep); }
  .gal figure:first-child { grid-column: span 2; }
  .gal img { width: 100%; height: 100%; aspect-ratio: 10 / 7; object-fit: cover; transition: transform .5s; }
  .gal figure:first-child img { aspect-ratio: auto; }
  .gal figure:hover img { transform: scale(1.04); }
  .gal figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 16px 12px; color: #fff; font-size: 14.5px; font-weight: 600; background: linear-gradient(to top, rgba(20,13,8,.85), rgba(20,13,8,0)); }

  /* news */
  .news { background: #fff; }
  .cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 40px; }
  .card { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--cream); display: flex; flex-direction: column; }
  .card img { width: 100%; height: auto; aspect-ratio: 12 / 7; object-fit: cover; }
  .card div { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
  .card time { font-family: Mono, monospace; font-size: 12.5px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--goldtxt); }
  .card p { font-size: 15.5px; color: #4A3829; }
  .card a { margin-top: auto; padding-top: 8px; font-weight: 600; font-size: 14.5px; color: var(--goldtxt); }

  /* values + contact */
  .values { background: var(--brown); color: var(--cream); padding: 64px 0; }
  .values .eyebrow { color: var(--gold2); }
  .values ul { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 22px; border-top: 1px solid rgba(230,194,114,.3); }
  .values li { padding: 18px 16px 18px 0; border-bottom: 1px solid rgba(230,194,114,.18); font-weight: 600; font-size: 16px; }
  .contact .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
  .contact .box { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 32px; }
  .contact .box div + div { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
  .contact small { display: block; font-family: Mono, monospace; font-size: 12px; letter-spacing: 2.2px; text-transform: uppercase; color: var(--goldtxt); margin-bottom: 4px; }
  .contact .box a, .contact .box span { font-weight: 600; font-size: 18px; }
  footer { background: var(--deep); color: #CFC3AE; padding: 40px 0; font-size: 14px; }
  footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
  footer img { height: 34px; width: auto; }

  @media (max-width: 900px) {
    section { padding: 68px 0; }
    .nav nav { display: none; }
    .about .grid, .feature, .contact .grid { grid-template-columns: 1fr; gap: 36px; }
    .feature { gap: 0; }
    .steps { grid-template-columns: 1fr 1fr; } .steps div { border-right: 0; padding: 22px 16px 10px 0; } .steps div + div { padding-left: 0; }
    .tl { grid-template-columns: 1fr; } .tl::before { left: 8px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; } .tl div { padding: 0 0 26px 38px; }
    .gal { grid-template-columns: 1fr 1fr; } .gal figure:first-child { grid-column: span 2; }
    .cards { grid-template-columns: 1fr; }
    .values ul { grid-template-columns: 1fr 1fr; }
    .facts { grid-template-columns: 1fr; } .facts div { padding: 14px 0 0; }
    .feature .txt { padding: 28px 22px; }
  }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .gal img { transition: none; } }

  /* detail pages (news articles and project pages), generated by scripts/build_pages.py */
  .wrap.narrow { max-width: 860px; }
  body.sub main { padding-top: 76px; }
  .phead { background: var(--deep); color: var(--cream); padding: 64px 0 56px; }
  .phead .eyebrow { color: var(--gold2); }
  .phead h1 { font-size: clamp(30px, 4.4vw, 50px); line-height: 1.18; }
  .phead h1 small { font-family: Mont, Arial, sans-serif; font-size: .45em; font-weight: 500; color: #D6CAB4; letter-spacing: 0; }
  .phead .sub { margin-top: 14px; font-size: 18px; color: #E2D8C6; font-weight: 500; }
  .back { display: inline-block; margin-bottom: 26px; font-size: 14.5px; font-weight: 600; color: var(--gold2); }
  .back:hover, .more a:hover b, .card h3 a:hover, .proj td a:hover, .feature h3 a:hover { text-decoration: underline; }
  .art { padding: 56px 0 96px; }
  .art p { font-size: 18.5px; line-height: 1.8; color: #33231A; }
  .art p + p { margin-top: 20px; }
  .lead-img { width: 100%; height: auto; border-radius: 6px; margin-bottom: 38px; }
  .facts2 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0 0 40px; background: #fff; border: 1px solid var(--line); border-radius: 6px; font-size: 16px; }
  .facts2 div { padding: 18px 20px; border-inline-end: 1px solid var(--line); }
  .facts2 div:last-child { border-inline-end: 0; }
  .facts2 dt { font-family: Mono, monospace; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--goldtxt); margin-bottom: 4px; }
  .facts2 dd { font-weight: 600; } .facts2 dd.now { color: var(--goldtxt); }
  .art .v3d { margin: 0 0 40px; }
  .morebox { margin-top: 64px; padding-top: 34px; border-top: 1px solid var(--line); }
  .morebox h2 { font-size: 26px; margin-bottom: 14px; }
  .more { list-style: none; }
  .more li { border-bottom: 1px solid var(--line); }
  .more a { display: block; padding: 15px 0; }
  .more time { display: block; font-family: Mono, monospace; font-size: 12.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--goldtxt); }
  .more b { font-size: 18px; font-weight: 600; }
  .feature .go { display: inline-block; margin-top: 22px; font-weight: 600; font-size: 15px; color: var(--goldtxt); }
  .proj td a { color: inherit; }
  /* film */
  .film { background: var(--deep); color: var(--cream); }
  .film .eyebrow { color: var(--gold2); }
  .film p.lead { color: #E2D8C6; }
  .film video { display: block; width: 100%; aspect-ratio: 16 / 9; margin-top: 36px; border-radius: 6px; background: #000; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
  @media (max-width: 900px) { .facts2 { grid-template-columns: 1fr 1fr; } .facts2 div:nth-child(2) { border-inline-end: 0; } .facts2 div:nth-child(-n+2) { border-bottom: 1px solid var(--line); } .phead { padding: 44px 0 40px; } }

  /* leadership page (scripts/build_lead.py) */
  .people .wrap { max-width: 1000px; display: grid; gap: 26px; }
  .person { display: grid; grid-template-columns: 240px 1fr; gap: 34px; align-items: start; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 28px; }
  .person.top { grid-template-columns: 300px 1fr; }
  .person img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 18%; border-radius: 4px; background: var(--sand); }
  .person h2 { font-size: 28px; margin-bottom: 2px; }
  .person h2 + small { display: block; color: var(--soft); font-size: 14px; }
  .person .pos { font-weight: 600; color: var(--goldtxt); margin: 4px 0 16px; }
  .person p { font-size: 16.5px; line-height: 1.75; }
  .person p + p { margin-top: 12px; }
  .person h4 { font-family: Mono, monospace; font-weight: 500; font-size: 12.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--goldtxt); margin: 16px 0 6px; }
  .person ul { list-style: none; }
  .person li { position: relative; padding-inline-start: 16px; font-size: 16px; line-height: 1.6; margin-bottom: 4px; }
  .person li::before { content: ""; position: absolute; inset-inline-start: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
  [dir=rtl] .person h2 { line-height: 1.5; }
  [dir=rtl] .person h4 { font-family: PlexAr, Mont, sans-serif; letter-spacing: 0; text-transform: none; font-size: 14.5px; font-weight: 600; }
  @media (max-width: 760px) { .person, .person.top { grid-template-columns: 1fr; gap: 18px; padding: 20px; } .person img { max-width: 260px; } }

  /* Moving between pages: the old page melts into the new one instead of flashing (browsers that support it; others change page as before). */
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .32s; }
  @media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
