/* The Drawing Room — static portfolio
   Gallery layout adapted from studiospace.nz: 12-col editorial grid,
   asymmetric rows (offset single / full-bleed / tall + stacked / 50-50 pair)
   with a hard-offset shadow on hover. */

:root {
  --accent: #1a1a1a;        /* hard-offset hover shadow colour */
  --ink: #1a1a1a;
  --muted: #8a8a8a;
  --gutter: 2rem;           /* space between grid columns */
  --row-gap: 3.25rem;       /* space between gallery rows (≈ reference row-pad) */
  --maxw: 1440px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Gallery ---------- */
.gallery { padding: 4.5rem 0 6rem; }

/* ---------- Intro (logo + studio text, left of the first project) ---------- */
.intro { align-self: start; }
.intro .logo {
  display: block;
  width: 400px;
  max-width: 100%;
  margin-bottom: 1rem;
}
.intro-text p {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  line-height: 1.65;
  color: #333;
}
.intro-text p:last-child { margin-bottom: 0; }
.intro-text a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  row-gap: var(--row-gap);
  margin-bottom: var(--row-gap);
}
.row:last-child { margin-bottom: 0; }

/* column spans / offsets mirroring Bootstrap col-md-* + offset-md-* */
.col-12  { grid-column: auto / span 12; }
.col-7   { grid-column: auto / span 7; }
.col-6   { grid-column: auto / span 6; }
.col-5   { grid-column: auto / span 5; }
.col-8   { grid-column: auto / span 8; }
.col-4   { grid-column: auto / span 4; }
.start-4 { grid-column-start: 4; }   /* offset-3 */
.start-6 { grid-column-start: 6; }   /* offset-5 */
.start-7 { grid-column-start: 7; }
.start-8 { grid-column-start: 8; }   /* col-5 offset-2 */
.start-9 { grid-column-start: 9; }   /* col-4 offset-2 */

/* two images stacked within one column */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--row-gap);
  align-items: flex-start;
}
/* col spans don't apply in a flexbox — size stacked figures relative to the
   col-6 stack: col-6 fills it, col-5 is 5/6 of it (≈ col-5 of the page) */
.stack > .col-6 { width: 100%; }
.stack > .col-5 { width: 83.333%; }

.proj { margin: 0; }

/* the image is a button that opens the project modal */
.proj-open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.proj img {
  width: 100%;
  transition: box-shadow .3s ease-in-out, transform .3s ease-in-out;
}
.proj-open:hover img,
.proj-open:focus-visible img {
  box-shadow: -18px 18px 0 0 var(--accent);
}
.proj-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

figcaption {
  margin-top: 1rem;
  font-size: 1rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: transform .3s ease-in-out;
}
/* title travels with the hover shadow (matches the image's -18px / 18px offset) */
.proj-open:hover ~ figcaption,
.proj-open:focus-visible ~ figcaption {
  transform: translate(-18px, 18px);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid #b3b24b;
  text-align: center;
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-logo {
  width: 450px;
  max-width: 100%;
  margin: 0 auto;
}
.footer-accreditations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 1.5rem auto;
}
.footer-badge {
  height: 70px;
  width: auto;
  max-width: 100%;
}

/* ---------- Project modal (1/4 description strip + 3/4 slider) ---------- */
body.modal-open { overflow: hidden; }

.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, .78);
}
.modal-box {
  position: relative;
  display: flex;
  width: min(1440px, 92vw);
  height: min(880px, 88vh);
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
  overflow: visible;
}

/* white 1/4-width description strip */
.modal-desc {
  flex: 0 0 25%;
  max-width: 25%;
  background: #fff;
  padding: 3rem 2rem;
  overflow-y: auto;
}
.modal-title {
  margin: 0 0 1.25rem;
  font-size: 1.6rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.3;
}
.modal-text { font-size: 1rem; line-height: 1.55; color: #333; }
.modal-text .placeholder { color: var(--muted); font-style: italic; }

/* slider fills the remaining 3/4; images are centre-cropped to the box */
.modal-slider {
  position: relative;
  flex: 1 1 75%;
  background: #111;
  overflow: hidden;
}
.slides {
  display: flex;
  height: 100%;
  transition: transform .4s ease;
}
.slide { flex: 0 0 100%; height: 100%; }
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .2s ease;
}
.slide-nav:hover { opacity: .7; }
.slide-nav[hidden] { display: none; }
.slide-nav.prev { left: 1rem; }
.slide-nav.next { right: 1rem; }

.slide-count {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: .72rem;
  letter-spacing: .12em;
  padding: .35rem .7rem;
}
.slide-count[hidden] { display: none; }

.modal-close {
  position: absolute;
  top: 0;              /* sits tightly in the top-right corner of the modal */
  right: 0;
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 0;
  background: rgba(255, 255, 255, .92);
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease;
}
.modal-close svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: #1a1a1a;
  stroke-width: 2;
  stroke-linecap: round;
  transition: transform .3s ease;
}
.modal-close:hover { background: #fff; }
.modal-close:hover svg { transform: rotate(90deg); }

@media (max-width: 768px) {
  .modal { padding: 0; }
  .modal-box {
    flex-direction: column;
    width: 100vw;
    height: 100vh;
  }
  .modal-slider { order: 1; flex: 1 1 auto; min-height: 0; }
  .modal-desc {
    order: 2;
    flex: 0 0 auto;
    max-width: none;
    max-height: 40%;
    padding: 1.75rem 1.5rem;
  }
}

/* ---------- Responsive: collapse the editorial grid on small screens ---------- */
@media (max-width: 768px) {
  :root { --row-gap: 2.25rem; }
  .gallery { padding-top: 2.5rem; }
  .row {
    grid-template-columns: 1fr;
    column-gap: 0;
  }
  /* every block becomes full-width, offsets removed */
  .col-12, .col-8, .col-7, .col-6, .col-5, .col-4,
  .start-4, .start-6, .start-7, .start-8, .start-9 {
    grid-column: 1 / -1;
  }
  .stack > .col-6, .stack > .col-5 { width: 100%; }
  .intro { margin-bottom: var(--row-gap); }
}
