/* Portfolio page. Loads after styles.css and reuses its colours, type and header. */

.gallery {
  display: grid;
  gap: 40px 28px;
  grid-template-columns: 1fr;
}

@media (min-width: 860px) {
  .gallery {
    grid-template-columns: 1fr 1fr;
  }

  .gallery .span-2 {
    grid-column: 1 / -1;
  }
}

.shot {
  margin: 0;
}

.shot-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  cursor: zoom-in;
}

.shot-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1920 / 935;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1018;
  transition: border-color 0.2s ease;
}

.shot-btn:hover img {
  border-color: var(--accent);
}

.shot figcaption {
  margin-top: 14px;
}

.shot-title {
  display: block;
  font-family: var(--display);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.shot-desc {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  text-wrap: pretty;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.facts li {
  padding: 2px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Full-size view */
.lightbox {
  width: min(96vw, 1600px);
  max-width: none;
  max-height: 94vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #05080f;
  color: var(--text);
}

.lightbox::backdrop {
  background: rgba(1, 3, 8, 0.86);
}

.lightbox img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(94vh - 72px);
  object-fit: contain;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
}

.lightbox-caption {
  font-weight: 700;
}

.lightbox-close {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

/* Model close-ups: smaller titles than the area shots */
.gallery-models {
  gap: 32px 28px;
}

.gallery-models .shot-title {
  font-size: 0.875rem;
}

/* Scripts */
.scripts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
}

.script {
  min-width: 0;
}

.script-head {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.script-title {
  margin: 0;
  font-size: 1.0625rem;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.script-desc {
  max-width: 72ch;
  color: var(--muted);
  text-wrap: pretty;
}

.script-head .facts {
  margin-top: 4px;
}

.script-where {
  font-size: 0.875rem;
  color: var(--muted);
}

.script-where code {
  font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.8125rem;
  color: var(--text);
}

.code {
  margin: 0;
  max-height: 460px;
  overflow: auto;
  padding: 16px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #070b13;
  font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  tab-size: 4;
  -moz-tab-size: 4;
}

.code:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.code code {
  display: block;
  min-width: max-content;
}

.code .line {
  display: block;
  padding-right: 20px;
  white-space: pre;
}

.code .line::before {
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: calc(4ch + 12px);
  margin-right: 18px;
  padding-left: 12px;
  color: #4b5568;
  text-align: right;
  user-select: none;
  -webkit-user-select: none;
}

.code .c { color: #7d8aa0; font-style: italic; }
.code .k { color: #c792ea; }
.code .s { color: #a5e07a; }
.code .n { color: #ffb86c; }
.code .l { color: #ff8fa3; }
.code .b { color: var(--accent); }
