/* Album pages (projects/ and services/, EN + AR). Same look as the homepage: tokens from hero.css, local fonts only. */
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-400-600.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
:root { --bg:#f2f0eb; --ink:#121212; --muted:#58554f; --line:rgb(18 18 18 / .12); --accent:#b48e52; --accent-ink:#7a5a26; --frame:#e6e2d9;
  --gutter:clamp(1rem, .8rem + 1.6vw, 2.5rem); --radius:.625rem; --ease:cubic-bezier(.2,.7,.2,1);
  --font:"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; --max:76rem; }
:root[lang="ar"] { --font:"Plex Arabic", "Inter", sans-serif; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.6 var(--font); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; margin: 0 0 .6em; }
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3, [lang="ar"] .al-eyebrow { letter-spacing: 0; line-height: 1.35; }
main { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 4rem; }
.al-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: var(--max); margin: 0 auto; padding: 1rem var(--gutter); }
.al-brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; font-weight: 500; }
.al-nav-end { display: flex; align-items: center; gap: .5rem; }
.al-lang { text-decoration: none; font-size: .9rem; padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.al-lang:hover { background: rgb(18 18 18 / .05); }
:root[lang="en"] .al-lang { font-family: "Plex Arabic", sans-serif; }
:root[lang="ar"] .al-lang { font-family: "Inter", sans-serif; }
.al-head { padding: clamp(1.5rem, 4vw, 3.5rem) 0 clamp(1.25rem, 3vw, 2.5rem); max-width: 48rem; }
.al-eyebrow { color: var(--accent-ink); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 .75rem; font-weight: 500; }
h1 { font-size: clamp(1.9rem, 1.2rem + 3vw, 3.4rem); }
.al-intro { color: var(--muted); font-size: clamp(1.02rem, .95rem + .3vw, 1.2rem); margin: 0 0 1.5rem; }
.al-cta { display: flex; flex-wrap: wrap; gap: .6rem; }
.al-btn { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .6rem 1.15rem; border-radius: 999px; border: 1px solid var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; transition: background .25s var(--ease), color .25s var(--ease); }
.al-btn:hover { background: var(--ink); color: var(--bg); }
.al-btn-primary { background: var(--ink); color: var(--bg); }
.al-btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }
/* Gallery (lane 7): justified rows. Each tile grows in proportion to its ratio (--r = w/h), so every photo in a row
   has the same height, rows run edge to edge and each photo is shown whole. The first photo is the hero, alone and
   whole on a neutral band. The last row keeps its natural height and starts at the reading side (RTL too). */
.al-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--gap); container-type: inline-size;
  --gap: 10px; --row: 128px; }
@media (min-width: 600px) { .al-grid { --row: 210px; } }
@media (min-width: 1100px) { .al-grid { --row: 270px; --gap: 12px; } }
.al-grid::after { content: ""; flex: 1000 1 0; }
.al-grid > li { flex: var(--r) 1 calc(var(--r) * var(--row)); min-width: 0; }
.al-grid > li:first-child { flex: 1 1 100%; }
.al-grid.al-few { --row: 205px; }            /* 2-4 photos: no hero band, larger balanced rows */
@media (min-width: 600px) { .al-grid.al-few { --row: 330px; } }
@media (min-width: 1100px) { .al-grid.al-few { --row: 420px; } }
.al-grid.al-center { justify-content: center; } .al-grid.al-center::after { display: none; }
.al-grid.al-few > li:first-child { flex: var(--r) 1 calc(var(--r) * var(--row)); }
.al-tile { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: zoom-in; border-radius: var(--radius); overflow: hidden; background: var(--frame); }
.al-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.al-tile picture, .pg-ph picture { display: contents; }
.al-tile img { width: 100%; height: auto; aspect-ratio: var(--r); transition: opacity .3s var(--ease); }
.al-tile:hover img, .al-rel a:hover img { opacity: .88; }
.al-grid:not(.al-few) > li:first-child .al-tile { display: flex; justify-content: center; }
.al-grid:not(.al-few) > li:first-child img { width: auto; max-width: 100%; height: min(72svh, 46rem, calc(100cqw / var(--r))); }
.al-sec { max-width: 48rem; padding-top: clamp(2rem, 5vw, 3.5rem); }
.al-sec h2, .al-links h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); }
.al-sec p { margin: 0 0 1em; }
.al-meta { display: grid; gap: .1rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); margin: 1rem 0 0; }
.al-meta div { border-top: 1px solid var(--line); padding: .6rem 0; }
.al-meta dt { color: var(--muted); font-size: .85rem; }
.al-meta dd { margin: 0; }
.al-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.al-cards li { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.al-cards h3 { font-size: 1rem; }
.al-cards p { color: var(--muted); font-size: .92rem; margin: 0; }
.al-list { padding-inline-start: 1.2rem; margin: 0; }
.al-list li { margin-bottom: .4rem; }
.al-faq { border-top: 1px solid var(--line); padding: .8rem 0; }
.al-faq summary { cursor: pointer; font-weight: 500; }
.al-faq p { color: var(--muted); margin: .6rem 0 0; }
.al-links { padding-top: clamp(2rem, 5vw, 3.5rem); }
.al-parent { margin: 0 0 1.5rem; color: var(--muted); }
.al-parent a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.al-rel { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.25rem .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.al-rel a { display: block; text-decoration: none; }
.pg-ph { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--frame); }
.pg-ph { position: relative; }
.pg-ph img { position: relative; width: 100%; height: 100%; object-fit: contain; transition: opacity .3s var(--ease); }
/* a photo whose proportions differ from the 4:3 card: the whole photo (never cut), its edges filled with its own
   soft blurred copy instead of empty bands */
.pg-blur { position: absolute; inset: 0; overflow: hidden; }
.pg-blur img { object-fit: cover; filter: blur(16px) saturate(1.05) brightness(.96); transform: scale(1.18); }
.pg-ph .pg-tile { width: 100%; height: 100%; border: 0; border-radius: 0; }
.pg-t { display: block; padding-top: .6rem; font-weight: 500; line-height: 1.35; }
.al-rel a:hover .pg-t { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
/* summary under the title, closing call to action */
.al-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .25rem 1.5rem; margin: 0 0 1.5rem; }
.al-sum div { border-top: 1px solid var(--line); padding: .55rem 0 0; }
.al-sum dt { color: var(--muted); font-size: .8rem; }
.al-sum dd { margin: 0; font-size: .95rem; }
.al-end { margin-top: clamp(2.5rem, 6vw, 4.5rem); padding: clamp(1.5rem, 4vw, 2.5rem); border-radius: calc(var(--radius) + .25rem); background: var(--frame); }
.al-end h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); }
.al-end p { color: var(--muted); margin: 0 0 1.25rem; max-width: 40rem; }
/* viewer */
.al-lb { position: fixed; inset: 0; z-index: 10; background: rgb(14 13 11 / .97); display: grid; place-items: center; touch-action: none; overscroll-behavior: contain; }
.al-lb[hidden] { display: none; }
.al-lb figure { margin: 0; display: grid; justify-items: center; gap: .75rem; padding: 3.5rem 1rem 1.25rem; max-width: 100%; }
.al-lb img { max-width: min(92vw, 110rem); max-height: calc(100dvh - 7rem); width: auto; height: auto; object-fit: contain; border-radius: .35rem; user-select: none; -webkit-user-drag: none; cursor: zoom-in; transform-origin: center; transition: transform .2s var(--ease); }
.al-lb.is-zoomed img { cursor: grab; border-radius: 0; }
.al-lb.is-zoomed .al-count { opacity: 0; }
.al-count { color: #ddd8cc; font-size: .9rem; font-variant-numeric: tabular-nums; direction: ltr; }
:where(.al-lb) button { all: unset; position: absolute; cursor: pointer; color: #f2f0eb; width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: 999px; background: rgb(255 255 255 / .08); font-size: 1.6rem; line-height: 1; }
.al-lb button:hover { background: rgb(255 255 255 / .18); }
.al-lb button:focus-visible { outline: 2px solid var(--accent); }
.al-lb-close { top: .75rem; inset-inline-end: .75rem; }
.al-lb-prev, .al-lb-next { top: 50%; transform: translateY(-50%); }
.al-lb-prev { inset-inline-start: .75rem; } .al-lb-next { inset-inline-end: .75rem; }
.al-lb-prev::before, .al-lb-next::before { content: ""; width: .7rem; height: .7rem; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg); margin-inline-start: .2rem; }
.al-lb-next::before { transform: rotate(-135deg); margin-inline-start: -.2rem; }
[dir="rtl"] .al-lb-prev::before { transform: rotate(-135deg); } [dir="rtl"] .al-lb-next::before { transform: rotate(45deg); }
@media (max-width: 560px) {

  .al-lb-prev, .al-lb-next { top: auto; bottom: .75rem; transform: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 599px) { .al-sum { grid-template-columns: 1fr 1fr; } .al-sum div:only-child { grid-column: 1 / -1; } }
