/* Alan J. King Photography
   A print wall: neutral grey like a print-viewing booth, so the only colour on
   the page comes from the photographs. Photographs are never cropped and never
   have text laid over them; words sit on the paper margin or on the wall. */

@font-face {
	font-family: "Libre Caslon Display";
	src: url("fonts/libre-caslon-display-latin-400-normal.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Jost";
	src: url("fonts/jost-latin-wght-normal.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

:root {
	--wall: #cfcfcc;   /* the wall */
	--paper: #fff;     /* print borders */
	--ink: #000;       /* type, contact band */
	--shade: #4a4a48;  /* secondary type on wall or paper */

	--serif: "Libre Caslon Display", "Big Caslon", "Book Antiqua", Palatino, Georgia, serif;
	--sans: "Jost", Futura, "Century Gothic", "Avenir Next", Avenir, system-ui, sans-serif;

	--edge: clamp(1.1rem, 3.2vw, 2.75rem);   /* page side margin */
	--hang: clamp(1.1rem, 2.6vw, 2.5rem);    /* space between prints on the home wall */
	--mat: clamp(7px, 0.9vw, 13px);          /* paper border on a home print */
	--page: 110rem;                          /* widest the wall gets */
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html:has(dialog[open]) { overflow: hidden; }

body {
	margin: 0;
	background: var(--wall);
	color: var(--ink);
	font: 400 1.0625rem/1.5 var(--sans);
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.skip { position: absolute; left: -200vw; top: 0.5rem; z-index: 20; background: var(--paper); padding: 0.5rem 0.9rem; }
.skip:focus { left: var(--edge); }


/* ---------------------------------------------------------------- header */

.site-head {
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem clamp(1.25rem, 2.6vw, 2.5rem);
	padding: 0.85rem var(--edge);
	background: var(--wall);
}

.mark { margin-right: auto; text-decoration: none; line-height: 1; }
.mark__name { display: block; font: 400 1.75rem/1 var(--serif); letter-spacing: 0.045em; }
.mark__craft { display: block; margin-top: 0.3rem; font-size: 0.8125rem; letter-spacing: 0.02em; }

.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.1rem clamp(1rem, 2vw, 1.9rem); margin: 0; padding: 0; list-style: none; }
.site-nav a { display: inline-block; padding: 0.3rem 0; text-decoration: none; border-bottom: 1.5px solid transparent; }
.site-nav a:hover,
.site-nav a[aria-current="page"] { border-bottom-color: currentColor; }

.site-head__phone { padding: 0.4rem 0.95rem; border: 1.5px solid var(--ink); font-weight: 500; white-space: nowrap; text-decoration: none; }
.site-head__phone:hover { background: var(--ink); color: var(--wall); }

@media (max-width: 62rem) {
	.site-head { position: static; }
	.site-nav { order: 3; flex-basis: 100%; }
}


/* ------------------------------------------------------------ home wall */

.wall {
	display: grid;
	row-gap: calc(var(--hang) + 2 * var(--mat));
	max-width: var(--page);
	margin-inline: auto;
	padding: clamp(1rem, 2.2vw, 2rem) calc(var(--edge) + var(--mat)) clamp(3.5rem, 8vw, 7rem);
}

.wall__row { display: flex; align-items: stretch; gap: calc(var(--hang) + 2 * var(--mat)); }

.walltext {
	flex: 0 0 clamp(14rem, 22%, 20.5rem);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 1.5rem;
	margin-left: calc(-1 * var(--mat));
}
.walltext h1 { margin: -0.12em 0 0; font: 400 clamp(1.6rem, 2.15vw, 2.4rem)/1.17 var(--serif); text-wrap: pretty; }
.walltext address { font-style: normal; line-height: 1.4; }

/* A print: white paper around the photograph, title in the bottom margin.
   The paper edge is a spread shadow so it takes no room in the row, which
   keeps every photograph in a row at exactly the same height. */
.print {
	flex: var(--r) 1 0;
	min-width: 0;
	display: block;
	align-self: flex-start;
	background: var(--paper);
	box-shadow: 0 0 0 var(--mat) var(--paper);
	text-decoration: none;
	container-type: inline-size;
}
.print:focus-visible { outline-offset: calc(var(--mat) + 3px); }
.print__photo { display: block; width: 100%; height: auto; aspect-ratio: var(--r); }
/* line heights are fixed lengths so every caption in a row is the same height
   even when a narrow print sets its title smaller */
.print__caption { display: block; padding: 0.6rem 0.1rem 0.25rem; }
.print__title { display: block; font: 400 clamp(1.05rem, 10.5cqi, 2rem)/2.3rem var(--serif); white-space: nowrap; }
.print__count { display: block; font-size: clamp(0.8rem, 6cqi, 0.9375rem); line-height: 1.4rem; color: var(--shade); white-space: nowrap; }
.print:hover .print__title { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.16em; }

@media (max-width: 62rem) {
	.wall__row { flex-wrap: wrap; }
	.walltext { flex-basis: 100%; margin-left: calc(-1 * var(--mat)); padding-bottom: 0.5rem; }
	.walltext h1 { font-size: clamp(1.6rem, 4.6vw, 2.4rem); max-width: 24em; }
}
@media (max-width: 40rem) {
	.print { flex-basis: 100%; }
	.print--half { flex-basis: 0; }
	.print--half .print__title { font-size: clamp(0.8rem, 11cqi, 2rem); line-height: 1.7rem; }
}
@media (max-width: 22.5rem) {
	.print--half { flex-basis: 100%; }
	.print--half .print__title { font-size: clamp(1.05rem, 10.5cqi, 2rem); line-height: 2.3rem; }
}

/* The one piece of motion: on arrival the home prints develop, like paper in a tray. */
@media (prefers-reduced-motion: no-preference) {
	.wall .print__photo {
		animation: develop 1.5s cubic-bezier(0.25, 0.6, 0.3, 1) backwards;   /* leaves no filter behind once it ends */
		animation-delay: calc(var(--i) * 150ms + 100ms);
	}
	@keyframes develop {
		from { opacity: 0; filter: grayscale(1) contrast(0.35) brightness(1.5); }
		55%  { opacity: 1; filter: grayscale(0.55) contrast(0.8) brightness(1.12); }
		to   { opacity: 1; filter: none; }
	}
}


/* -------------------------------------------------------- gallery pages */

.pagehead {
	max-width: var(--page);
	margin-inline: auto;
	padding: clamp(1.25rem, 4.5vw, 4rem) var(--edge) clamp(1.5rem, 3.2vw, 2.75rem);
}
.pagehead h1 { margin: 0 0 0.16em -0.035em; font: 400 clamp(3.1rem, 10.5vw, 9.5rem)/0.95 var(--serif); letter-spacing: -0.012em; }
.pagehead p { margin: 0; color: var(--shade); }

/* Proofs hang in justified rows at their own proportions. Each one's width is
   its aspect ratio times the row height, and it grows in the same proportion,
   so a row fills the wall without cropping anything. */
.proofs {
	--row: 300px;
	--m: 6px;
	display: flex;
	flex-wrap: wrap;
	gap: calc(1rem + 2 * var(--m));
	max-width: var(--page);
	margin-inline: auto;
	padding: var(--m) calc(var(--edge) + var(--m)) 0;
}
.proofs::after { content: ""; flex: 1000000 1 0; }   /* stops the last row stretching */

.proof {
	flex: calc(var(--r) * 100) 1 calc(var(--r) * var(--row));
	min-width: 0;
	display: block;
	background: var(--paper);
	box-shadow: 0 0 0 var(--m) var(--paper);
	cursor: zoom-in;
}
.proof img { display: block; width: 100%; height: auto; aspect-ratio: var(--r); }
.proof:hover { box-shadow: 0 0 0 var(--m) var(--ink); }
.proof:focus-visible { outline-offset: calc(var(--m) + 3px); }

@media (max-width: 62rem) { .proofs { --row: 230px; } }
@media (max-width: 40rem) { .proofs { --row: 150px; --m: 4px; gap: calc(0.6rem + 2 * var(--m)); } }

.pager {
	display: flex;
	justify-content: space-between;
	gap: 2rem;
	max-width: var(--page);
	margin-inline: auto;
	padding: clamp(3rem, 7vw, 6.5rem) var(--edge);
}
.pager a { text-decoration: none; }
.pager a[rel="next"] { margin-left: auto; text-align: right; }
.pager__way { display: block; color: var(--shade); }
.pager__name { display: block; font: 400 clamp(1.6rem, 4.2vw, 3.25rem)/1.1 var(--serif); }
.pager a:hover .pager__name { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.14em; }


/* --------------------------------------------------- contact and footer */

.contact { background: var(--ink); color: #fff; }
.contact :focus-visible { outline-color: #fff; }
.contact__inner {
	display: grid;
	gap: clamp(2rem, 5vw, 4.5rem);
	align-items: end;
	max-width: var(--page);
	margin-inline: auto;
	padding: clamp(3rem, 8vw, 7.5rem) var(--edge) clamp(2.5rem, 5vw, 4.5rem);
}
.contact--print .contact__inner { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }

.contact__call { margin: 0; font: 400 clamp(2.5rem, 8.4vw, 8.25rem)/0.98 var(--serif); letter-spacing: -0.01em; }
.contact--print .contact__call { font-size: clamp(2.5rem, 6.6vw, 6.75rem); }
.contact__call a { text-decoration: none; }
.contact__call a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.1em; }
.contact__number { white-space: nowrap; }

.contact address { margin-top: clamp(1.25rem, 2.5vw, 2rem); font-style: normal; font-size: 1.25rem; line-height: 1.4; }
.contact__directions { display: inline-block; margin-top: 0.6rem; text-underline-offset: 0.2em; }

.contact__print { margin: 0; padding: var(--mat); background: var(--paper); }
.contact__print img { display: block; width: 100%; height: auto; }

@media (max-width: 50rem) {
	.contact--print .contact__inner { grid-template-columns: minmax(0, 1fr); }
	.contact--print .contact__call { font-size: clamp(2.5rem, 12vw, 6rem); }
	.contact__call { font-size: clamp(2.5rem, 12vw, 6rem); }
}

.site-foot { background: var(--ink); color: #fff; }
.site-foot__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1.25rem 2rem;
	max-width: var(--page);
	margin-inline: auto;
	padding: 0 var(--edge) clamp(2rem, 4vw, 3rem);
}
.site-foot__card { display: block; width: 13.5rem; padding: 0.55rem 0.9rem; background: var(--paper); }
.site-foot__card img { display: block; width: 100%; height: auto; }
.site-foot p { margin: 0; }


/* ------------------------------------------------------------- viewer */

.viewer { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; color: #fff; }
.viewer::backdrop { background: #000; }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer :focus-visible { outline-color: #fff; }

.viewer__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem var(--edge); }
.viewer__count { margin: 0; }
.viewer__stage { position: relative; margin: 0 var(--edge); cursor: pointer; }
.viewer__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; -webkit-user-select: none; user-select: none; }
.viewer__nav { display: flex; justify-content: center; gap: 0.75rem; padding: 0.8rem var(--edge) 1rem; }

.viewer button { min-width: 6.5rem; padding: 0.45rem 1rem; border: 1.5px solid #fff; background: none; color: #fff; font: 500 1rem/1.4 var(--sans); cursor: pointer; }
.viewer button:hover { background: #fff; color: #000; }
