@import url("../assets/cores.css");

:root {
  --mono: 'Courier New', monospace;
  --gap: 3px;
  --bar: 65px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font: 16px/1.35 Arial, Helvetica, sans-serif; }
a { color: inherit; text-underline-offset: .23em; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }

.masthead {
  min-height: var(--bar);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: .25rem 1rem;
  padding: .4rem clamp(.75rem, 2vw, 2rem);
  border-bottom: 1px solid var(--line);
}
.masthead h1 { grid-column: 2; margin: 0; font: 400 clamp(1.65rem, 2.4vw, 2.5rem)/1 var(--serif); letter-spacing: -.045em; }
.masthead a { text-decoration: none; }
.masthead nav { display: flex; justify-content: end; align-items: center; flex-wrap: wrap; column-gap: clamp(.65rem, 1.35vw, 1.3rem); font-size: .9rem; }
.masthead nav a { display: inline-flex; align-items: center; min-height: 40px; padding-inline: .25rem; }
.masthead nav a[aria-current], .masthead nav a:hover { text-decoration: underline; text-decoration-thickness: 1px; background: var(--accent); }

.photo-wall {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: max(105px, calc((100svh - var(--bar) - 4 * var(--gap)) / 5));
  gap: var(--gap);
}
.wall-photo {
  position: relative;
  border: 0;
  padding: 0;
  overflow: hidden;
  background: var(--accent-soft);
  cursor: zoom-in;
}
.wall-photo:focus-visible { outline-offset: -4px; z-index: 1; }
.wall-photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 240ms ease, filter 240ms ease; }
@media (hover: hover) { .wall-photo:hover img { transform: scale(1.035); filter: brightness(1.12); } }
.wall-status { margin: 1rem; color: var(--muted); }
.wall-status:empty { display: none; }

.photo-viewer {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--background);
  color: var(--ink);
}
body:has(.photo-viewer[open]) { overflow: hidden; }
.photo-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.viewer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .65rem clamp(.75rem, 2vw, 1.6rem);
  border-bottom: 1px solid var(--line);
}
.viewer-counter { margin: 0; color: var(--muted); font: .88rem var(--mono); }
.viewer-close, .viewer-nav {
  border: 1px solid var(--focus);
  background: var(--accent);
  min-height: 44px;
}
.viewer-close { padding: .35rem .75rem; }
.viewer-close:hover, .viewer-nav:hover { background: var(--accent-soft); }
.viewer-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 255px);
  min-height: 0;
  overflow: auto;
}
.viewer-frame {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: clamp(.3rem, 1.3vw, 1.15rem);
  min-height: 0;
  padding: clamp(.45rem, 1.6vw, 1.3rem);
}
.viewer-image { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.viewer-nav { width: 44px; border-radius: 50%; font-size: 1.6rem; line-height: 1; }
.viewer-details { padding: clamp(.8rem, 2vw, 1.45rem); border-left: 1px solid var(--line); }
.viewer-title { margin: 0 0 .7rem; font: 400 clamp(1.3rem, 2vw, 1.65rem)/1.1 var(--serif); }
.photo-data { margin-top: 1.3rem; }
.photo-data div { padding-block: .48rem; border-top: 1px solid var(--line); }
.photo-data dt { font-size: .825rem; color: var(--muted); }
.photo-data dd { margin: .14rem 0 0; font: .9rem/1.4 var(--mono); overflow-wrap: anywhere; }
.photo-data dd[data-missing] { color: var(--muted); }

.project-page {
  max-width: 1320px;
  margin-inline: auto;
  padding: clamp(2rem, 12vh, 8rem) clamp(1rem, 4vw, 4rem);
}
.project-page h2 { font: 400 clamp(2.6rem, 9vw, 7rem)/.9 var(--serif); letter-spacing: -.055em; margin: 0 0 1.4rem; }
.project-empty { color: var(--muted); border-top: 1px solid var(--line); padding-top: .95rem; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px),1fr)); gap: 1.6rem; }
.project-grid article { min-width: 0; }
.project-grid img, .project-grid video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--accent-soft); }
.project-grid h3 { margin: .55rem 0; font: 400 1.4rem var(--serif); }
.project-grid p { margin: 0; color: var(--muted); }

@media (min-width: 1480px) { .photo-wall { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .masthead { grid-template-columns: auto 1fr; }
  .masthead h1 { grid-column: 1; }
  .photo-wall { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { --bar: 102px; }
  .masthead { grid-template-columns: 1fr; justify-items: center; }
  .masthead nav { justify-content: center; }
  .photo-wall { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: max(105px, 23vw); }
  .viewer-content { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(205px, 51svh) auto; }
  .viewer-details { border-left: 0; border-top: 1px solid var(--line); }
  .photo-data { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .75rem; }
  .viewer-nav { width: 37px; }
}
@media (max-width: 460px) {
  .photo-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 36vw; }
  .masthead nav { font-size: .86rem; column-gap: .75rem; }
}
@media (prefers-reduced-motion: reduce) { .wall-photo img { transition: none; } }
