/*
 * Photography templates — archive (/photography/) and single
 * (/photography/{slug}/). Loaded only on those views (see inc/enqueue.php).
 * Depends on the shared cascade: tokens -> base -> layout -> components.
 * Uses existing tokens only. Introduced in Phase 3B-2. Mobile-first.
 *
 * Distinct from Film: images sit on the page ground with no box or overlay,
 * their own aspect ratio is preserved (nothing is hard-cropped), and the
 * single-view gallery is image-aware — tall portrait frames are capped so
 * they never run the full page height.
 *
 * Shared primitives (.schusei-section-label, .schusei-pagination,
 * .schusei-empty, .schusei-meta-list) live in components.css.
 */

/* ===================================================== PHOTOGRAPHY ARCHIVE */
.schusei-photo-archive.schusei-main {
	max-width: var(--sch-width-wide);
}

.schusei-photo-archive__header {
	margin-bottom: var(--sch-space-xl);
}

.schusei-photo-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--sch-space-2xl) var(--sch-space-lg);
	align-items: start;
}

@media (min-width: 48em) {
	.schusei-photo-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* -------------------------------------------------------------- one entry */
.schusei-photo-item {
	position: relative;
	min-width: 0;
	margin: 0;
}

/* No box, no background, no forced ratio — the image defines its own height. */
.schusei-photo-item__media {
	display: block;
}

.schusei-photo-item__image {
	width: 100%;
	height: auto;
	transition: opacity var(--sch-duration-base) var(--sch-ease);
}

.schusei-photo-item__placeholder {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	background-color: var(--sch-bg-raised);
	box-shadow: inset 0 0 0 1px var(--sch-border);
}

.schusei-photo-item:hover .schusei-photo-item__image,
.schusei-photo-item:focus-within .schusei-photo-item__image {
	opacity: 0.88;
}

.schusei-photo-item__title {
	margin: var(--sch-space-sm) 0 0;
	font-size: var(--sch-text-heading);
	font-weight: 400;
	line-height: var(--sch-leading-snug);
	overflow-wrap: anywhere;
}

.schusei-photo-item__link {
	color: var(--sch-text);
	text-decoration: none;
}

/* Stretch the title link over the whole entry; a11y name stays the title. */
.schusei-photo-item__link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.schusei-photo-item__link:focus-visible {
	outline: none;
}

.schusei-photo-item__link:focus-visible::after {
	outline: 2px solid var(--sch-accent-warm);
	outline-offset: 4px;
}

.schusei-photo-item__meta {
	margin: var(--sch-space-3xs) 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: var(--sch-space-2xs) var(--sch-space-sm);
	font-size: var(--sch-text-micro);
	letter-spacing: var(--sch-tracking-wide);
	text-transform: uppercase;
	color: var(--sch-text-secondary);
}

/* ====================================================== PHOTOGRAPHY SINGLE */
.schusei-photo-single.schusei-main {
	max-width: var(--sch-width-content);
}

.schusei-photo > * + * {
	margin-top: var(--sch-space-xl);
}

/* ------------------------------------------------------------- header */
.schusei-photo__back {
	margin: 0 0 var(--sch-space-lg);
	font-size: var(--sch-text-micro);
	letter-spacing: var(--sch-tracking-wide);
	text-transform: uppercase;
}

.schusei-photo__back a {
	color: var(--sch-text-secondary);
	text-decoration: none;
}

.schusei-photo__back a:hover,
.schusei-photo__back a:focus-visible {
	color: var(--sch-text);
}

.schusei-photo__title {
	margin: 0;
	font-size: var(--sch-text-title);
	font-weight: 400;
	line-height: var(--sch-leading-tight);
	overflow-wrap: anywhere;
}

.schusei-photo__meta {
	margin: var(--sch-space-sm) 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: var(--sch-space-2xs) var(--sch-space-sm);
	font-size: var(--sch-text-micro);
	letter-spacing: var(--sch-tracking-wide);
	text-transform: uppercase;
	color: var(--sch-text-secondary);
}

/* In-text links sit inline with non-link meta; an underline is the non-colour
   cue that keeps them distinguishable (WCAG 1.4.1). */
.schusei-photo__meta a {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.schusei-photo__meta a:hover,
.schusei-photo__meta a:focus-visible {
	color: var(--sch-text);
}

/* ------------------------------------------------------------- hero */
.schusei-photo__hero {
	margin: var(--sch-space-xl) 0 0;
}

.schusei-photo__hero-image {
	width: 100%;
	height: auto;
}

/* ------------------------------------------------------------- body */
.schusei-photo__body {
	font-size: var(--sch-text-body);
}

/* ------------------------------------------------------------- details */
.schusei-photo__details {
	margin-top: var(--sch-space-xl);
}

/* -------------------------------------------------- image-aware gallery */
.schusei-photo__gallery-section {
	margin-top: var(--sch-space-xl);
}

.schusei-photo-gallery {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--sch-space-xl);
	justify-items: center;
}

.schusei-photo-gallery .schusei-gallery__item {
	margin: 0;
	width: 100%;
	text-align: center;
}

/* width:auto + max-height caps tall portrait frames so they are exhibited,
   not oversized; landscape stays wide. No object-fit, so nothing is cropped.
   Dark page ground shows around a narrow portrait. */
.schusei-photo-gallery .schusei-gallery__image {
	display: inline-block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 80vh;
}

.schusei-photo-gallery .schusei-gallery__caption {
	margin-top: var(--sch-space-2xs);
	font-size: var(--sch-text-micro);
	letter-spacing: var(--sch-tracking-wide);
	color: var(--sch-text-secondary);
}

/* ------------------------------------------------------- previous / next */
.schusei-photo__pager {
	display: grid;
	gap: var(--sch-space-md);
	padding-top: var(--sch-space-lg);
	border-top: 1px solid var(--sch-border);
}

.schusei-photo__pager-link {
	display: flex;
	flex-direction: column;
	gap: var(--sch-space-3xs);
	text-decoration: none;
	color: var(--sch-text-secondary);
}

.schusei-photo__pager-dir {
	font-size: var(--sch-text-micro);
	letter-spacing: var(--sch-tracking-wide);
	text-transform: uppercase;
	color: var(--sch-text-secondary);
}

.schusei-photo__pager-title {
	font-size: var(--sch-text-small);
	color: var(--sch-text);
}

.schusei-photo__pager-link:hover .schusei-photo__pager-title,
.schusei-photo__pager-link:focus-visible .schusei-photo__pager-title {
	color: var(--sch-accent-warm);
}

@media (min-width: 40em) {
	.schusei-photo__pager {
		grid-template-columns: 1fr 1fr;
	}

	.schusei-photo__pager-link--next {
		text-align: right;
	}
}
