@import url("https://use.typekit.net/myu0kss.css");

/* =========================================================
   AlAyham Ali — main.css
   Desktop layout. Breakpoints for the mobile version will be
   added at the bottom of this file (see "RESPONSIVE" section).
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --black: #111111;
  --white: #f2efeb;

  --font: "neue-haas-grotesk-display", sans-serif;
  --fs: 17px;
  --lh: 1.25;

  --cols: 6;
  --gutter: 10px;
  --pad: 10px;            /* inner padding of sections */
  --section-gap: 10px;    /* space between sections */
  --part-gap: 10px;       /* space between parts inside a section */
  --site-margin: 10px;    /* outer margin around the whole website */
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  padding: var(--site-margin);
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  font-weight: 600;  /* Medium */
  font-style: normal;
  font-size: var(--fs);
  line-height: var(--lh);
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;   /* keep ratio even when width/height attributes are set */
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.25s ease;
}

/* Hover for all links (the Preview Link button inverts instead — see .btn) */
a:not(.btn):hover,
a:not(.btn):focus-visible {
  opacity: 0.5;
}

ul {
  list-style: none;
}

em {
  font-style: italic;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

body.no-scroll {
  overflow: hidden;
}

/* ---------- Grid (lives inside each section) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
}

.span-1   { grid-column: 1 / span 1; }
.span-2   { grid-column: span 2; }
.span-1-2 { grid-column: 1 / 3; }
.span-2-3 { grid-column: 2 / 4; }
.span-5-6 { grid-column: 5 / 7; }
.span-1-5 { grid-column: 1 / 6; }
.span-6   { grid-column: 6 / 7; }
.col-4    { grid-column: 4 / 5; }
.col-5    { grid-column: 5 / 6; }
.col-6    { grid-column: 6 / 7; }

/* ---------- Text blocks ---------- */
/* A blank line between paragraphs = one line-height */
.text p + p,
.text p + img {
  margin-top: calc(var(--fs) * var(--lh));
}

/* Lighter weight (500, loaded by the Adobe Fonts kit above), all sizes:
   - Section 02: the second text block (two paragraphs)
   - Sections 03–06: the location, and the two long paragraphs
     (not the "Awards" label in Section 05) */
.info .span-5-6,
.work__main .span-1 > p:nth-child(2),
.work__main .span-5-6 > p:nth-of-type(-n + 2) {
  font-weight: 500;
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  width: 100%;
}

.section + .section,
main > .section:first-child {
  margin-top: var(--section-gap);
}

/* Space above the footer (desktop & up to 880px; mobile sets its own) */
main + .footer {
  margin-top: 100px;
}

main > .section {
  display: flow-root;              /* keeps the shots' bottom margin inside the section */
}

/* Section 02: extra black space below it (mobile: 70px) */
.section--spaced {
  margin-bottom: 100px;
}

/* Section 04 (no shots row): same black space at its bottom as the
   shots row gives Sections 03, 05 & 06 (mobile: 70px) */
.section--end-space {
  padding-bottom: 100px;
}

/* Full-frame background image + optional black multiply overlay */
.hero,
.info,
.work__main {
  position: relative;
  background-color: var(--black);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.has-overlay::before,
.hero::before,
.info::before,
.work__main--atyg::before,
.work__main--adand::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--black);
  mix-blend-mode: multiply;
  opacity: var(--overlay, 0.3);
  pointer-events: none;
}

/* Content sits above the overlay */
.hero > *,
.info > *,
.work__main > * {
  position: relative;
}

/* ---------- SECTION 01 — Hero / Nav ---------- */
.hero {
  height: 50vh;
  padding: var(--pad);
  background-image: url("../assets/works/ATYG/ATYG_04.jpg");
  --overlay: 0.3;
}

.nav {
  align-items: start;
}

.nav__logo {
  grid-column: 1 / 2;
  width: 160px;
}

.nav__logo img {
  width: 160px;
}

.nav__links {
  display: contents;  /* lets each <li> sit on the section grid */
}

.nav__links li {
  text-align: right;
}

.nav__links a {
  display: inline-block;
}

/* ---------- SECTION 02 — Info ---------- */
.info {
  height: 100vh;
  padding: var(--pad);
  background-image: url("../assets/images/ayham.jpg");
  --overlay: 0.7;
}

/* ---------- Works — main part ---------- */
.work__main {
  height: 100vh;
  padding: var(--pad);
}

.work__main--atyg {
  background-image: url("../assets/works/ATYG/ATYG_00_main.jpg");
  --overlay: 0.3;
}

.work__main--adand {
  background-image: url("../assets/works/ADAND/ADAND_00_main.jpg");
  --overlay: 0.3;
}

.work__main--tb {
  background-image: url("../assets/works/TB/TB_00_main.jpg");
}

.work__main--23 {
  background-image: url("../assets/works/23/23_00_main.jpg");
}

/* Space between location and the Preview Link button (Sections 04–06):
   2 blank lines, so it scales with the type at every breakpoint.
   The extra selector outranks the mobile row-spacing rule. */
.work__main .span-1 > p.work__link {
  margin-top: calc(var(--fs) * var(--lh) * 2);
}

/* Preview link button */
.btn {
  display: inline-block;
  padding: 6px 12px 5px;
  border: 2px solid var(--white);
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}

.btn:hover {
  background: var(--white);
  color: var(--black);
}

/* Awards image under the paragraphs */
.awards {
  width: 100%;
  margin-top: calc(var(--fs) * var(--lh) * 0.6);
}

/* ---------- Works — shots rows ---------- */
.shots {
  margin-top: var(--part-gap);
  margin-bottom: 100px;  /* space under every shots row / carousel */
  padding: 0;            /* full section width */
}

.shot {
  display: block;
  width: 100%;
  cursor: zoom-in;
}

.shot img {
  width: 100%;
  height: auto;
}

/* ---------- Carousel ---------- */
.carousel {
  position: relative;
}

/* Native horizontal scrolling: works with touchpad swipes, touch
   and the arrows. Snaps to the start of a shot; scrollbar hidden. */
.carousel__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;   /* don't trigger browser back/forward */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.carousel__viewport::-webkit-scrollbar {
  display: none;
}

.carousel__track {
  --shot-w: calc((100% - (var(--cols) - 1) * var(--gutter)) / var(--cols) * 2 + var(--gutter));
  display: flex;
  gap: var(--gutter);
}

.carousel__track .shot {
  flex: 0 0 var(--shot-w);
  scroll-snap-align: start;
}

.carousel__arrow {
  position: absolute;
  top: 50%;
  width: 30px;
  height: 30px;
  transform: translateY(-50%);
  opacity: 1;
  transition: opacity 0.3s;
}

.carousel__arrow img {
  width: 100%;
  height: 100%;
}

.carousel__arrow--prev { left: 15px; }
.carousel__arrow--next { right: 15px; }

.carousel__arrow.is-disabled {
  opacity: 0.4;
  cursor: default;
}

/* ---------- SECTION 05 — Nominations ---------- */
.nominations {
  height: 50vh;
  margin-top: var(--part-gap);
  padding: 20px;
  background: var(--black) url("../assets/works/TB/nominations/nominations_bg_h.jpg") center / cover no-repeat;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.nominations__content {
  grid-column: 2 / 3;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;   /* vertically centred in the section */
  gap: calc(var(--fs) * var(--lh) * 2.5);
}

.nominations__content img {
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* ---------- SECTION 07 — Footer ---------- */
.footer {
  height: 30vh;
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.footer__grid {
  align-items: start;
}

.footer__logo img {
  width: 100%;
}

/* Links column: stacked together, top aligned with the top of the logo */
.footer__links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 17, 17, 0.85);
  opacity: 0;
  transition: opacity 0.3s;
}

.lightbox[hidden] {
  display: none;
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox__img {
  height: 80vh;
  width: auto;
  max-width: 90vw;
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: 40px;
  right: 40px;
  width: 30px;
  height: 30px;
}

.lightbox__close img {
  width: 100%;
  height: 100%;
}

/* A shots row whose shots all fit (nothing to scroll) shows no arrows.
   .is-static is toggled in main.js, so the same row can be a plain row
   on desktop and a carousel on smaller screens. */
.carousel.is-static .carousel__arrow {
  display: none;
}

/* =========================================================
   SMALL SCREENS  (880px wide and below)
   Same layout as desktop, only the type is smaller.
   Placed before the mobile block so 430px and below keeps 13px.
   ========================================================= */
@media (max-width: 880px) {
  :root {
    --fs: 14px;
  }

  /* Every shot spans 3 columns (2 visible at a time); rows with more
     than 2 shots (Sections 03 & 05) become carousels automatically. */
  .carousel__track {
    --shot-w: calc((100% - var(--gutter)) / 2);
  }

  /* Section 02 and the first part of Sections 03–06
     (mobile sets its own heights further down) */
  .info,
  .work__main {
    height: 60vh;
  }

  /* Section 05 — Additional Nominations part */
  .nominations {
    height: 30vh;
  }

  /* Section 04 stays a full screen tall */
  .work__main--adand {
    height: 100vh;
  }
}

/* =========================================================
   MEDIUM-SMALL SCREENS  (745px wide and below)
   Same layout as 880px, only 13px type.
   ========================================================= */
@media (max-width: 745px) {
  :root {
    --fs: 13px;
  }
}

/* =========================================================
   MOBILE  (breakpoint: 430px wide and below)
   3-column grid, same gutter and margins, 12.3px type.
   ========================================================= */
@media (max-width: 430px) {

  :root {
    --cols: 3;
    --fs: 12.3px;
  }

  /* Section 02 */
  .section--spaced {
    margin-bottom: 70px;
  }

  /* Section 04 */
  .section--end-space {
    padding-bottom: 70px;
  }

  /* ---------- SECTION 01 — Hero / Nav ---------- */
  .hero {
    height: 35vh;
    background-position: center center;
  }

  .nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }

  .nav__logo,
  .nav__logo img {
    width: 140px;
  }

  .nav__links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
  }

  /* ---------- SECTION 02 — Info ---------- */
  .info {
    height: 80vh;
    background-image: url("../assets/images/ayham_v.jpg");
    background-position: center top;
  }

  /* first paragraph at the top, second from the vertical centre */
  .info > .grid {
    height: 100%;
    grid-template-rows: 50% 50%;
  }

  .info .span-1-2 { grid-area: 1 / 1 / 2 / 4; }
  .info .span-5-6 { grid-area: 2 / 1 / 3 / 4; }

  /* ---------- Works — main part ---------- */
  /* Background spans the frame width, height follows the image; the
     image fades to black at its bottom, the rest of the frame is black. */
  .work__main {
    height: 70vh;    /* Sections 03, 04 & 06 first part (05 is 80vh) */
    background-color: var(--black);
    background-size: 100% auto;
    background-position: center top;
  }

  .work__main--atyg  { background-image: url("../assets/works/ATYG/ATYG_00_main_v.jpg"); }
  /* No black overlay on Sections 03 & 04 on mobile */
  .work__main--atyg::before,
  .work__main--adand::before {
    content: none;
  }

  .work__main--adand {
    height: 70vh;    /* Section 04 too (880px block sets it to 100vh) */
    background-image: url("../assets/works/ADAND/ADAND_00_main_v.jpg");
  }
  .work__main--tb {
    height: 80vh;    /* Section 05 only */
    background-image: url("../assets/works/TB/TB_00_main_v.jpg");
  }
  .work__main--23    { background-image: url("../assets/works/23/23_00_main_v.jpg"); }

  /* Rows: 1 number | title, 2 location | credits, 3 button,
     4 filler, 5 paragraphs — row 5 always starts at the vertical centre. */
  .work__main > .grid {
    height: 100%;
    grid-template-rows: auto auto auto 1fr minmax(50%, max-content);
    align-items: start;
  }

  /* Unwrap the two left text blocks so number/title and
     location/credits share rows and stay aligned from the top. */
  .work__main .span-1,
  .work__main .span-2-3 {
    display: contents;
  }

  .work__main .span-1 > *,
  .work__main .span-2-3 > * {
    margin-top: 0;
  }

  .work__main .span-1 > :nth-child(1)   { grid-area: 1 / 1 / 2 / 2; }
  .work__main .span-1 > :nth-child(2)   { grid-area: 2 / 1 / 3 / 2; }
  .work__main .span-1 > :nth-child(3)   { grid-area: 3 / 1 / 4 / 2; }
  .work__main .span-2-3 > :nth-child(1) { grid-area: 1 / 2 / 2 / 4; }
  /* Credits run down into the filler row, so their height never pushes
     the button down: location → button is one blank line in every section. */
  .work__main .span-2-3 > :nth-child(2) { grid-area: 2 / 2 / 5 / 4; }
  .work__main .span-5-6                 { grid-area: 5 / 1 / 6 / 4; }

  /* one blank line between rows 1–2 and 2–3 */
  .work__main .span-1 > :nth-child(2),
  .work__main .span-1 > :nth-child(3),
  .work__main .span-2-3 > :nth-child(2) {
    margin-top: calc(var(--fs) * var(--lh));
  }

  /* SECTIONS 03–06: the paragraphs (+ awards in 05) sit at the
     bottom of the frame instead of starting from the centre */
  .work__main .span-5-6 {
    align-self: end;
  }

  .btn {
    padding: 4px 6px 3px;
    border-width: 1.5px;
  }

  /* ---------- Shots → one-at-a-time carousels ---------- */
  .shots {
    padding: 0;            /* full section width, no side padding */
    margin-bottom: 70px;   /* space under every carousel */
  }

  .carousel__track {
    --shot-w: 100%;
  }

  .carousel__arrow--prev { left: 10px; }
  .carousel__arrow--next { right: 10px; }

  /* ---------- SECTION 05 — Nominations ---------- */
  .nominations {
    height: 50vh;
    padding: var(--pad);
    background-image: url("../assets/works/TB/nominations/nominations_bg_v.jpg");
    background-size: 100% auto;
    background-position: center top;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }

  /* heading + logos in the bottom half, full width */
  .nominations__content {
    grid-area: 2 / 1 / 3 / 2;
    gap: calc(var(--fs) * var(--lh) * 1.5);
  }

  /* ---------- SECTION 07 — Footer ---------- */
  main + .footer {
    margin-top: var(--section-gap);   /* mobile keeps the normal 10px gap */
  }

  .footer {
    height: 20vh;
  }

  .footer__grid {
    row-gap: calc(var(--fs) * var(--lh) * 2);
  }

  /* links in a full-width row above the logo, starting from the left,
     with an equal space between them */
  .footer__links {
    grid-area: 1 / 1 / 2 / 4;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 50px;
  }

  .footer__logo {
    grid-area: 2 / 1 / 3 / 4;
  }

  /* ---------- Lightbox ---------- */
  .lightbox__img {
    width: calc(100vw - 2 * var(--site-margin));
    max-width: none;
    height: auto;
    max-height: 80vh;
  }

  .lightbox__close {
    top: 25px;
    right: 25px;
    width: 15px;
    height: 15px;
  }
}

/* =========================================================
   VERY SMALL SCREENS  (280px wide and below)
   Same as the mobile layout above, only the type is smaller.
   Must stay after the mobile block.
   ========================================================= */
@media (max-width: 280px) {
  :root {
    --fs: 11px;
  }
}
