/* ==========================================================================
   Stefan Sokolovski — desktop stylesheet.
   Desktop layout first; one mobile breakpoint at the very bottom of the file.
   ========================================================================== */

/* --- the three things you'll most likely want to change ------------------ */
:root {
  --page-width: 1280px;
  /* whole layout */
  --menu-width: 300px;
  /* left column */
  --gallery-width: 750px;
  /* right column holding the photos */

  --cell-shape: 3 / 4;
  /* grid cell proportion */
  --cell-fit: cover;
  /* cover = fill the cell (uniform grid, may crop)
                               contain = show the whole photo (never crops)  */
  --cell-gap: 10px;
  --columns: 3;

  --ink: #1e1e1e;
  --paper: #fdfdfd;
}

/* --- base ---------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 3rem;
  background: var(--paper);
  color: var(--ink);
  font: 300 1.05rem/1.5 "Fira Sans", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  text-decoration: none;
}

img {
  max-width: 100%;
}

.page {
  max-width: var(--page-width);
  margin: 0 auto;
}

/* --- header -------------------------------------------------------------- */
.header {
  display: flex;
  align-items: center;
  height: 6rem;
}

.logo img {
  height: 3.2rem;
  width: auto;
  display: block;
}

/* --- body: menu on the left, photos on the right ------------------------- */
.body {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.menu {
  width: var(--menu-width);
  flex: none;
  line-height: 1.85;
  padding-bottom: 6rem;
}

.menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu .active>a {
  font-weight: 700;
}

/* sub-items appear only under the section you're in */
.menu .sub {
  display: none;
  margin-left: .8rem;
  font-size: .88em;
}

.menu .active .sub {
  display: block;
}

.gallery-column {
  width: var(--gallery-width);
  flex: none;
  padding-bottom: 6rem;
}

/* --- the photo grid ------------------------------------------------------ */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--columns), 1fr);
  gap: var(--cell-gap);
  align-items: start;
}

.cell {
  display: block;
}

.cell img {
  display: block;
  width: 100%;
  aspect-ratio: var(--cell-shape);
  object-fit: var(--cell-fit);
}

.cell:hover img {
  opacity: .85;
}

/* label under the cover tiles on Designer Campaigns / Celebrities */
.cell .label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  padding-top: .45rem;
}

/* --- text pages (About, Contact) ----------------------------------------- */
/* portrait on the left, bio text beside it on the right */
.text {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
}

/* a text page needs more room than the photo grid's fixed column,
   otherwise there is nowhere for the bio to sit */
.gallery-column:has(.text) {
  width: auto;
  flex: 1;
}

.portrait {
  flex: none;
}

/* keep the whole portrait visible on landing, without scrolling.
   6rem header + fixed footer + breathing room = the 11rem below. */
.text img {
  max-height: calc(100vh - 11rem);
  width: auto;
}

.bio {
  flex: 1;
  max-width: 34em;
}

.bio p {
  margin: 0 0 1.1em;
}

/* links inside text pages look exactly like the text around them */
.text a {
  color: inherit;
  text-decoration: none;
}

/* --- footer -------------------------------------------------------------- */
.footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  background: var(--paper);
  padding: 1rem 0;
  text-align: center;
}

.footer a {
  display: inline-block;
  margin: 0 1rem;
}

.footer svg {
  width: 22px;
  height: 22px;
  fill: var(--ink);
  display: block;
}

/* --- click a photo to see it large --------------------------------------- */
.viewer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(253, 253, 253, .98);
  z-index: 10;
  cursor: zoom-out;
}

.viewer.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer img {
  max-width: 92vw;
  max-height: 92vh;
  width: auto;
  height: auto;
}

.viewer .arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  padding: 1rem;
  cursor: pointer;
  user-select: none;
  color: var(--ink);
}

.viewer .prev {
  left: 1rem;
}

.viewer .next {
  right: 1rem;
}

.viewer .count {
  position: absolute;
  bottom: 1.5rem;
  width: 100%;
  text-align: center;
  font-size: .85rem;
}
/* --- mobile ---------------------------------------------------------------
   The Menu bar exists only on narrow screens; on desktop it is hidden and
   nothing below this line applies, so the desktop layout is untouched.
   -------------------------------------------------------------------------- */
.menu-bar {
  display: none;
}

@media (max-width: 767px) {
  body {
    padding: 0 1rem;
  }

  .header {
    height: 4.5rem;
  }

  .logo img {
    height: 2.2rem;
  }

  /* menu sits above the photos instead of beside them */
  .body {
    display: block;
  }

  .menu {
    width: auto;
    padding-bottom: 0;
    margin-bottom: 1.25rem;
  }

  .menu-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
  }

  .menu-toggle {
    cursor: pointer;
  }
  .menu-prev,
  .menu-next {
    width: 2.5rem;
    font-size: 1.35rem;
    line-height: 1;
  }

  .menu-prev {
    text-align: left;
  }

  .menu-next {
    text-align: right;
  }

  /* the section list stays closed until Menu is tapped */
  .menu>ul {
    display: none;
    text-align: center;
  }

  .menu.open>ul {
    display: block;
  }

  .menu .sub {
    margin-left: 0;
  }

  .gallery-column {
    width: auto;
    padding-bottom: 5rem;
  }

  /* About: portrait above the bio rather than beside it */
  .text {
    display: block;
  }

  .portrait {
    margin-bottom: 1.5rem;
  }
  .text img {
    max-height: 70vh;
    display: block;
    margin: 0 auto;
  }

  .bio {
    max-width: none;
  }
}

/* --- tablet ---------------------------------------------------------------
   Same structure as desktop — menu left, photos right — but flexible instead
   of fixed. The desktop widths need 1178px, so anything narrower must flex or
   it overflows sideways.
   -------------------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 1199px) {
  body {
    padding: 0 1.5rem;
  }

  .body {
    gap: 1.5rem;
  }

  .menu {
    width: 11rem;
  }

  .gallery-column {
    width: auto;
    flex: 1;
    min-width: 0;
    max-width: var(--gallery-width);
  }

  /* About: portrait stays beside the bio, but small enough to leave
     the text a readable column */
  .text {
    gap: 1.5rem;
  }

  .portrait {
    flex: 0 0 40%;
  }

  .portrait img {
    width: 100%;
    max-height: none;
  }

  .bio {
    max-width: none;
  }
}
