/* Bahaa Ghoussainy — site styles (matches the original Squarespace design) */
:root {
  --pad: max(20px, 3vw);
  --gap: 2.5vw;
  --text: #000;
  --muted: #808080;
  --bg: #fff;
  --title-font: "Raleway", "Helvetica Neue", Arial, sans-serif;
  --body-font: "Poppins", "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body-font); font-weight: 300; font-size: 17.4px; line-height: 1.8; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
figure { margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 38px var(--pad); position: sticky; top: 0; z-index: 20; background: var(--bg); transition: padding .25s ease, box-shadow .25s ease; }
.site-header.is-scrolled { padding-top: 18px; padding-bottom: 18px; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.site-title { font-family: var(--title-font); font-weight: 200; font-size: 29.3px; line-height: 1.3; color: rgba(0,0,0,.8); text-decoration: none; letter-spacing: .01em; }
.site-nav { display: flex; align-items: center; gap: 34px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 26px; align-items: center; }
.site-nav li { position: relative; }
.site-nav a, .sub-toggle { font: 300 13.7px/1.7 var(--body-font); color: var(--muted); text-decoration: none; background: none; border: 0; padding: 4px 0; cursor: pointer; }
.site-nav a:hover, .sub-toggle:hover, .site-nav .active > a, .site-nav .active > .sub-toggle, .site-nav a[aria-current] { color: var(--text); }
.site-nav .active > a, .site-nav .active > .sub-toggle { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.sub { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background: var(--bg); padding: 10px 18px !important; display: none !important; flex-direction: column; gap: 2px !important; white-space: nowrap; }
.has-sub:hover .sub, .has-sub:focus-within .sub, .has-sub.open .sub { display: flex !important; }
.socials { display: flex; gap: 18px; align-items: center; }
.social { color: var(--muted); display: inline-flex; }
.social:hover { color: var(--text); }
.social svg { width: 15px; height: 15px; }
.menu-toggle { display: none; background: none; border: 0; width: 40px; height: 30px; position: relative; cursor: pointer; padding: 0; }
.menu-toggle span { position: absolute; right: 0; height: 1px; background: var(--text); transition: transform .3s, width .3s, top .3s; }
.menu-toggle span:first-child { top: 9px; width: 40px; }
.menu-toggle span:last-child { top: 20px; width: 30px; }
.menu-open .menu-toggle span:first-child { top: 15px; transform: rotate(45deg); width: 32px; }
.menu-open .menu-toggle span:last-child { top: 15px; transform: rotate(-45deg); width: 32px; }

/* ---------- home ---------- */
.home-slideshow { position: relative; height: 75vh; margin: 0 var(--pad) var(--pad); }
.home-slideshow .slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.home-slideshow .slide.is-active { opacity: 1; }
.home-slideshow img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- index grids ---------- */
.index-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; padding: 0 var(--pad) 40px; }
.card { text-decoration: none; display: block; }
.card .thumb { aspect-ratio: 1 / 1; overflow: hidden; background: #f4f4f4; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.card:hover img { opacity: .85; }
.card h3 { font: 300 13.7px/1.5 var(--body-font); text-align: center; margin: 12px 0 0; }

/* ---------- projects ---------- */
.hero { height: 50vh; min-height: 280px; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.block { margin: 0 var(--pad) var(--gap); }
.intro { padding: 5vh 0 4vh; max-width: 51%; min-width: min(100%, 640px); }
.intro h1 { font: 300 22px/1.5 var(--body-font); margin: 0 0 14px; }
.intro p { margin: 0 0 8px; }
.intro p.small { font-size: 13.5px; }
.intro .description { margin-top: 14px; }
.intro .description p { margin: 0 0 1em; }
.text-block { max-width: 51%; min-width: min(100%, 640px); padding: 4vh 0; }
.text-block h3, .text-block h4 { font: 400 15px/1.6 var(--body-font); margin: 1.4em 0 .3em; }
.text-block p:empty { display: none; }

.gallery.full { margin-left: 0; margin-right: 0; }
.gallery.grid { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: var(--gap); }
.gallery.cropped figure { aspect-ratio: var(--ratio); overflow: hidden; }
.gallery.cropped img { width: 100%; height: 100%; object-fit: cover; }
.gallery.grid:not(.cropped) img { width: 100%; }
.gallery.masonry { column-count: var(--cols); column-gap: var(--gap); }
.gallery.masonry figure { break-inside: avoid; margin-bottom: var(--gap); }
.gallery.masonry img { width: 100%; }
.gallery img[data-full] { cursor: zoom-in; }
.gallery figcaption { font-size: 13.7px; text-align: center; padding-top: 10px; }

.slideshow { position: relative; padding: 2vh 0 6vh; }
.slideshow .slide { display: none; }
.slideshow .slide.is-active { display: block; }
.slideshow img { height: 75vh; width: 100%; object-fit: contain; }
.slideshow figcaption a { text-decoration: none; }
.ss-prev, .ss-next { position: absolute; top: calc(2vh + 37.5vh); transform: translateY(-50%); background: none; border: 0; font: 200 44px/1 var(--body-font); color: var(--muted); cursor: pointer; padding: 10px; }
.ss-prev { left: 0; } .ss-next { right: 0; }
.ss-prev:hover, .ss-next:hover { color: var(--text); }

.pagination { display: flex; justify-content: space-between; gap: 20px; padding: 6vh var(--pad); border-top: 1px solid #eee; margin-top: 4vh; }
.pagination a { text-decoration: none; font-size: 15px; display: flex; flex-direction: column; }
.pagination a span { font-size: 12px; color: var(--muted); }
.pagination .next { text-align: right; }

/* ---------- contact form ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 7vw; padding: 5vh 0 8vh; align-items: start; }
.contact-text p { margin: 0 0 1em; }
.contact-text h3 { font: 400 13px/1.6 var(--body-font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 2em 0 .4em; }
.contact-text > p:first-child { font: 300 22px/1.5 var(--body-font); }
.contact-text a { text-decoration: none; }
.contact-form { display: grid; gap: 22px; }
.contact-form .row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.contact-form label { display: grid; gap: 8px; font-size: 13px; letter-spacing: .02em; }
.contact-form .lbl em { font-style: normal; color: var(--muted); }
.contact-form input, .contact-form textarea { font: 300 15px/1.5 var(--body-font); color: var(--text); background: #fafafa; border: 1px solid #dcdcdc; border-radius: 0; padding: 12px 14px; width: 100%; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: #000; background: #fff; }
.contact-form textarea { resize: vertical; min-height: 150px; }
.contact-form .invalid { border-color: #b3261e; }
.contact-form button { justify-self: start; font: 400 13px/1 var(--body-font); letter-spacing: .14em; text-transform: uppercase; color: #fff; background: #000; border: 1px solid #000; padding: 16px 34px; cursor: pointer; transition: background .2s, color .2s; }
.contact-form button:hover { background: #fff; color: #000; }
.contact-form button[disabled] { opacity: .5; cursor: wait; }
.contact-form .hp { position: absolute; left: -9999px; }
.form-status { margin: 0; font-size: 14px; min-height: 1.5em; }
.form-status.error { color: #b3261e; }
.contact-form.sent label, .contact-form.sent .row, .contact-form.sent button { display: none; }
.contact-form.sent .form-status { font-size: 18px; }

/* ---------- hub page (e.g. Work) ---------- */
.hub { min-height: 55vh; display: flex; align-items: center; justify-content: center; padding: 6vh var(--pad); }
.hub ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.hub a { font: 300 24px/1.4 var(--body-font); color: var(--text); text-decoration: none; letter-spacing: .02em; border-bottom: 1px solid transparent; transition: border-color .2s; }
.hub a:hover { border-bottom-color: var(--text); }

/* ---------- about / contact ---------- */
.text-image { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 6vw; align-items: start; padding: 4vh 0 6vh; }
.text-image.img-left { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
.text-image.img-left figure { order: -1; }
.text-image .ti-text p { margin: 0 0 1em; }
.text-image .ti-text p:empty { display: none; }
.text-image figure { position: sticky; top: 30px; }
.text-image img { width: 100%; }
.page-contact .text-block { padding-top: 6vh; }
.page-contact .text-block > p:first-child { font: 300 22px/1.5 var(--body-font); }
.page-contact a { text-decoration: none; }
.notfound { padding: 15vh 0; }

/* ---------- footer ---------- */
.site-footer { text-align: center; padding: 60px var(--pad) 50px; font-size: 12px; color: var(--muted); }
.site-footer p { margin: 0 0 14px; }
.site-footer .socials { justify-content: center; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(255,255,255,.98); z-index: 100; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 88vw; max-height: 90vh; object-fit: contain; }
.lightbox button { position: absolute; background: none; border: 0; cursor: pointer; color: #333; font: 200 46px/1 var(--body-font); padding: 14px; }
.lb-close { top: 10px; right: 16px; font-size: 40px !important; }
.lb-prev { left: 10px; } .lb-next { right: 10px; }

/* ---------- smaller screens ---------- */
@media (max-width: 1023px) {
  .intro, .text-block { max-width: none; min-width: 0; }
  .index-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }
}
@media (max-width: 767px) {
  body { font-size: 16px; }
  .site-header { padding: 28px var(--pad); }
  .site-header.is-scrolled { padding-top: 16px; padding-bottom: 16px; }
  .site-title { font-size: 22.8px; margin: 0 auto; }
  .menu-toggle { display: block; position: absolute; right: var(--pad); }
  .site-nav { display: none; position: fixed; inset: 0; background: var(--bg); flex-direction: column; align-items: center; justify-content: center; gap: 36px; z-index: 15; padding: 90px var(--pad) 40px; }
  .menu-open { overflow: hidden; }
  .menu-open .site-nav { display: flex; }
  .menu-open .site-title, .menu-open .menu-toggle { position: relative; z-index: 16; }
  .site-nav ul { flex-direction: column; gap: 18px; text-align: center; }
  .site-nav a, .sub-toggle { font: 400 16px/1.6 var(--body-font); letter-spacing: .03em; color: var(--text); padding: 2px 0; }
  .site-nav .active > a { text-decoration: underline; text-underline-offset: 6px; }
  button.sub-toggle { cursor: default; pointer-events: none; text-decoration: none !important; }
  .hub a { font-size: 20px; }
  .has-sub { display: flex; flex-direction: column; align-items: center; gap: 6px; }
  .sub { position: static; transform: none; display: flex !important; padding: 0 !important; gap: 10px !important; align-items: center; background: none; }
  .site-nav .sub a { font-weight: 300; font-size: 15px; color: #444; }
  .site-nav .sub a[aria-current] { color: var(--text); text-decoration: underline; text-underline-offset: 6px; }
  .site-nav .socials { gap: 22px; }
  .text-image, .text-image.img-left { grid-template-columns: 1fr; gap: 28px; padding: 1vh 0 4vh; }
  .text-image figure { order: -1; position: static; }
  .text-image .ti-text { font-size: 14.5px; line-height: 1.75; }
  .contact { grid-template-columns: 1fr; gap: 40px; padding-top: 2vh; }
  .contact-text { font-size: 14.5px; }
  .contact-form .row.two { grid-template-columns: 1fr; }
  .contact-form button { justify-self: stretch; }
  .index-grid { grid-template-columns: 1fr; }
  .gallery.grid.cols-3, .gallery.grid.cols-4, .gallery.grid.cols-5, .gallery.grid.cols-6 { grid-template-columns: repeat(2, 1fr); }
  .gallery.masonry.cols-3, .gallery.masonry.cols-4, .gallery.masonry.cols-5, .gallery.masonry.cols-6 { column-count: 2; }
  .home-slideshow { height: 60vh; }
  .slideshow img { height: 60vh; }
  .ss-prev, .ss-next { top: calc(2vh + 30vh); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
