/*
 * The ՀՃՄ archive (old-member): the gallery on /history/senior-partners/
 * (sections/old_members.php) and each record's page (single-old-member.php).
 *
 * Portraits sit in the chamber's arch, as the founders do on the history page,
 * and take the same shared sepia: the register's scans vary in tone, and one
 * treatment makes a shelf of them read as a set.
 */

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

.arm-oms {
	scroll-margin-top: calc(var(--arm-header-h, 72px) + 12px);
}

.arm-oms__head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
	gap: 20px 48px;
	margin-bottom: 40px;
}

.arm-oms__title {
	margin: 0;
	text-align: left;
	letter-spacing: 0.08em;
}

.arm-oms__aside {
	display: flex;
	align-items: flex-end;
	gap: 32px;
}

.arm-oms__text {
	max-width: 440px;
	font-size: 15px;
	line-height: 1.7;
	color: rgba(0, 0, 0, 0.75);
}

.arm-oms__text p {
	margin: 0;
}

.arm-oms__total {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin: 0;
	font-size: 13px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--arm-muted);
	white-space: nowrap;
}

.arm-oms__total strong {
	font-family: var(--arm-font-head);
	font-size: 64px;
	font-weight: 400;
	line-height: 0.9;
	letter-spacing: 0.02em;
	color: var(--arm-brown);
}

/* The rail: the periods as stops on one line, oldest first. */
.arm-oms__rail {
	margin-bottom: 28px;
	padding: 22px 26px 18px;
	border: 1px solid var(--arm-line);
	border-radius: 20px;
	background: var(--arm-surface);
	box-shadow: 0 18px 40px -30px rgba(40, 30, 20, 0.45);
	transition: opacity 0.3s ease;
}

.arm-oms__rail-label {
	margin: 0 0 16px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--arm-brown);
}

.arm-oms__periods {
	position: relative;
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
}

.arm-oms__stop {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
}

/* The line the stops sit on: each stop draws its share, so it runs from the
   first dot to the last however many periods there are. */
.arm-oms__stop::before {
	content: "";
	position: absolute;
	top: 8px;
	left: 0;
	right: 0;
	height: 2px;
	background: var(--arm-gold);
}

.arm-oms__stop:first-child::before {
	left: 50%;
}

.arm-oms__stop:last-child::before {
	right: 50%;
}

.arm-oms__period {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 7px;
	padding-bottom: 4px;
	color: inherit;
	text-align: center;
	text-decoration: none;
}

.arm-oms__dot {
	position: relative;
	z-index: 1;
	width: 18px;
	height: 18px;
	border: 2px solid var(--arm-gold);
	border-radius: 50%;
	background: var(--arm-surface);
	transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.arm-oms__range {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
	white-space: nowrap;
	color: var(--arm-text);
	transition: color 0.2s ease;
}

.arm-oms__count {
	min-width: 30px;
	padding: 1px 8px;
	border-radius: 999px;
	background: rgba(211, 163, 73, 0.14);
	font-size: 12px;
	line-height: 1.5;
	color: var(--arm-muted);
	transition: background-color 0.2s ease, color 0.2s ease;
}

.arm-oms__period:hover .arm-oms__dot,
.arm-oms__period:focus-visible .arm-oms__dot {
	background: var(--arm-gold);
	transform: scale(1.12);
}

.arm-oms__period:hover .arm-oms__range {
	color: var(--arm-brown);
}

.arm-oms__period.is-active .arm-oms__dot {
	border-color: var(--arm-brown);
	background: var(--arm-brown);
	box-shadow: 0 0 0 5px rgba(211, 163, 73, 0.3);
	transform: scale(1.18);
}

.arm-oms__period.is-active .arm-oms__range {
	color: var(--arm-brown);
}

.arm-oms__period.is-active .arm-oms__count {
	background: var(--arm-brown);
	color: #fff;
}

/* While a search runs across every period, no stop is the current one. */
.arm-oms.is-searching .arm-oms__rail {
	opacity: 0.55;
}

.arm-oms__tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 24px;
	margin-bottom: 36px;
	scroll-margin-top: calc(var(--arm-header-h, 72px) + 16px);
}

.arm-oms__search {
	position: relative;
	flex: 0 1 460px;
	min-width: 0;
}

.arm-oms__search-icon {
	position: absolute;
	top: 50%;
	left: 18px;
	color: var(--arm-brown);
	transform: translateY(-50%);
	pointer-events: none;
}

.arm-oms__input {
	width: 100%;
	height: 50px;
	padding: 0 18px 0 48px;
	border: 1px solid var(--arm-line);
	border-radius: 999px;
	background: var(--arm-surface);
	font: inherit;
	font-size: 15px;
	color: var(--arm-text);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.arm-oms__input::placeholder {
	color: var(--arm-muted);
}

.arm-oms__input:focus {
	border-color: var(--arm-gold);
	outline: none;
	box-shadow: 0 0 0 4px rgba(211, 163, 73, 0.2);
}

.arm-oms__status {
	margin: 0;
	font-size: 13px;
	letter-spacing: 0.06em;
	color: var(--arm-muted);
}

.arm-oms__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.arm-oms__body {
	transition: opacity 0.25s ease;
}

.arm-oms__body.is-loading {
	opacity: 0.45;
}

.arm-oms__empty,
.arm-oms__more {
	margin: 12px 0 0;
	padding: 18px 22px;
	border: 1px dashed var(--arm-line);
	border-radius: 14px;
	font-size: 14px;
	text-align: center;
	color: var(--arm-muted);
}

/* ---------------------------------------------------------------- the shelf */

/* A centred wrap, not a grid: a short last row sits in the middle, as the
   founders' row does above. */
.arm-oms__grid {
	--om-cols: 6;
	--om-gap: 24px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 40px var(--om-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.arm-om {
	flex: 0 0 calc((100% - (var(--om-cols) - 1) * var(--om-gap)) / var(--om-cols));
	min-width: 0;
	animation: arm-om-in 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
	animation-delay: calc(var(--i, 0) * 28ms);
}

@keyframes arm-om-in {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
}

.arm-om__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	color: inherit;
	text-decoration: none;
}

.arm-om__frame {
	display: block;
	width: 100%;
	max-width: 170px;
	aspect-ratio: 3 / 4;
	padding: 5px;
	overflow: hidden;
	border: 1.5px solid var(--arm-gold);
	border-radius: 999px 999px 14px 14px;
	background: var(--arm-surface);
	transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.45s ease, border-color 0.3s ease;
}

.arm-om__img,
.arm-om__mono {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 999px 999px 9px 9px;
}

.arm-om__img {
	object-fit: cover;
	object-position: 50% 18%;
	filter: grayscale(1) sepia(0.28) contrast(1.06) brightness(1.02);
	transition: filter 0.6s ease;
}

.arm-om__mono {
	display: grid;
	place-items: center;
	padding-top: 12%;
	background: radial-gradient(120% 85% at 50% 0%, #fcf8f1 0%, #f0e7d9 55%, #e2d4bf 100%);
	font-family: var(--arm-font-head);
	font-size: 34px;
	line-height: 1;
	color: var(--arm-brown);
}

.arm-om__link:hover .arm-om__frame,
.arm-om__link:focus-visible .arm-om__frame {
	transform: translateY(-6px);
	border-color: var(--arm-brown);
	box-shadow: 0 22px 36px -20px rgba(60, 40, 20, 0.5);
}

.arm-om__link:hover .arm-om__img,
.arm-om__link:focus-visible .arm-om__img {
	filter: grayscale(0.15) sepia(0.12) contrast(1.04);
}

.arm-om__link:focus-visible {
	outline: none;
}

.arm-om__name {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 14px;
	max-width: 100%;
	overflow-wrap: anywhere;
}

.arm-om__surname {
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.02em;
	color: var(--arm-text);
	transition: color 0.2s ease;
}

.arm-om__link:hover .arm-om__surname {
	color: var(--arm-brown);
}

.arm-om__given {
	font-size: 12.5px;
	line-height: 1.35;
	color: var(--arm-muted);
}

.arm-om__years {
	margin-top: 7px;
	font-family: var(--arm-font-head);
	font-size: 15px;
	letter-spacing: 0.06em;
	color: var(--arm-brown);
}

/* ------------------------------------------------------------- record page */

.arm-omp {
	padding-top: 36px;
	background: var(--arm-bg);
}

.arm-omp__back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 36px;
	padding: 8px 16px 8px 10px;
	border: 1px solid var(--arm-line);
	border-radius: 999px;
	background: var(--arm-surface);
	font-size: 13.5px;
	font-weight: 600;
	color: var(--arm-brown);
	text-decoration: none;
	transition: border-color 0.2s ease, transform 0.2s ease;
}

.arm-omp__back:hover,
.arm-omp__back:focus-visible {
	border-color: var(--arm-gold);
	transform: translateX(-3px);
}

.arm-omp__grid {
	display: grid;
	grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
	align-items: start;
	gap: 72px;
	padding-bottom: 80px;
}

.arm-omp__media {
	position: relative;
	padding: 0 24px 24px 0;
}

.arm-omp__halo {
	position: absolute;
	inset: 24px 0 0 24px;
	border: 1.5px solid var(--arm-gold);
	border-radius: 999px 999px 20px 20px;
}

.arm-omp__frame {
	position: relative;
	z-index: 1;
	display: block;
	aspect-ratio: 3 / 4;
	padding: 8px;
	overflow: hidden;
	border: 2px solid var(--arm-brown);
	border-radius: 999px 999px 16px 16px;
	background: var(--arm-surface);
	box-shadow: 0 34px 60px -32px rgba(50, 30, 15, 0.6);
}

.arm-omp__img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 999px 999px 10px 10px;
	object-fit: cover;
	object-position: 50% 18%;
	filter: grayscale(1) sepia(0.28) contrast(1.06) brightness(1.02);
}

.arm-omp__frame .arm-om__mono {
	font-size: 88px;
}

.arm-omp__eyebrow {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	margin: 8px 0 14px;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--arm-brown);
}

.arm-omp__eyebrow::before {
	content: "";
	width: 34px;
	height: 1.5px;
	background: var(--arm-gold);
}

.arm-omp__name {
	margin: 0 0 12px;
	font-family: var(--arm-font-head);
	font-weight: 400;
	line-height: 0.95;
	letter-spacing: 0.02em;
}

.arm-omp__surname {
	display: block;
	font-size: clamp(46px, 6vw, 84px);
	color: var(--arm-text);
}

.arm-omp__given {
	display: block;
	margin-top: 6px;
	font-size: clamp(24px, 2.8vw, 38px);
	color: var(--arm-brown);
}

.arm-omp__years {
	display: inline-block;
	margin: 6px 0 28px;
	padding: 6px 16px;
	border: 1.5px solid var(--arm-gold);
	border-radius: 999px;
	font-family: var(--arm-font-head);
	font-size: 22px;
	letter-spacing: 0.08em;
	color: var(--arm-brown);
}

.arm-omp__lead {
	max-width: 680px;
	margin: 0 0 16px;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.55;
	color: var(--arm-text);
}

/* The register's lines, each led by a short gold dash. */
.arm-omp__facts,
.arm-omp__works-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.arm-omp__facts {
	max-width: 680px;
	font-size: 16px;
	line-height: 1.6;
	color: rgba(0, 0, 0, 0.8);
}

.arm-omp__facts li,
.arm-omp__works-list li {
	position: relative;
	padding-left: 18px;
	break-inside: avoid;
}

.arm-omp__facts li + li {
	margin-top: 8px;
}

.arm-omp__facts li::before,
.arm-omp__works-list li::before {
	content: "";
	position: absolute;
	top: 0.8em;
	left: 0;
	width: 9px;
	height: 1.5px;
	background: var(--arm-gold);
}

.arm-omp__works-list li + li {
	margin-top: 6px;
}

.arm-omp__works-list.is-long {
	column-count: 2;
	column-gap: 36px;
}

.arm-omp__works {
	max-width: 680px;
	margin-top: 26px;
	padding: 22px 26px;
	border-left: 3px solid var(--arm-gold);
	border-radius: 0 18px 18px 0;
	background: var(--arm-surface);
	box-shadow: 0 16px 36px -28px rgba(40, 30, 20, 0.45);
	font-size: 15px;
	line-height: 1.75;
	color: rgba(0, 0, 0, 0.75);
}


.arm-omp__works-title {
	margin: 0 0 10px;
	font-family: inherit;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--arm-brown);
}

.arm-omp__peers {
	padding-block: 56px 72px;
	border-top: 1px solid var(--arm-line);
	background: rgba(255, 255, 255, 0.55);
}

.arm-omp__peers-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px 24px;
	margin-bottom: 32px;
}

.arm-omp__peers-title {
	margin: 0;
	font-family: var(--arm-font-head);
	font-size: clamp(24px, 2.6vw, 32px);
	font-weight: 400;
	letter-spacing: 0.06em;
}

.arm-omp__peers-all {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 700;
	color: var(--arm-brown);
	text-decoration: none;
}

.arm-omp__peers-all:hover svg {
	transform: translateX(3px);
}

.arm-omp__peers-all svg {
	transition: transform 0.2s ease;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
	.arm-oms__grid {
		--om-cols: 5;
	}
}

@media (max-width: 1024px) {
	/* The rail scrolls sideways once the stops no longer fit. */
	.arm-oms__rail {
		padding-inline: 0;
	}

	.arm-oms__rail-label {
		padding-inline: 22px;
	}

	.arm-oms__periods {
		overflow-x: auto;
		padding: 0 22px 6px;
		scroll-snap-type: x proximity;
		scrollbar-width: thin;
		-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
		mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
	}

	.arm-oms__stop {
		flex: 0 0 96px;
		scroll-snap-align: center;
	}

	.arm-oms__grid {
		--om-cols: 4;
	}
}

@media (max-width: 900px) {
	.arm-oms__head {
		grid-template-columns: minmax(0, 1fr);
		align-items: start;
	}

	.arm-omp__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 36px;
		padding-bottom: 56px;
	}

	.arm-omp__media {
		width: min(320px, 82%);
		margin: 0 auto;
	}
}

@media (max-width: 768px) {
	.arm-oms__grid {
		--om-cols: 3;
		--om-gap: 16px;
		row-gap: 32px;
	}
}

@media (max-width: 600px) {
	.arm-oms__aside {
		flex-direction: column;
		align-items: flex-start;
		gap: 14px;
	}

	.arm-oms__total strong {
		font-size: 52px;
	}

	.arm-oms__search {
		flex-basis: 100%;
	}

	.arm-om__frame {
		padding: 4px;
	}

	.arm-om__name {
		margin-top: 10px;
	}

	.arm-om__surname {
		font-size: 13px;
	}

	.arm-om__given,
	.arm-om__years {
		font-size: 12px;
	}

	.arm-omp__back {
		margin-bottom: 26px;
	}

	.arm-omp__lead {
		font-size: 17px;
	}

	.arm-omp__facts {
		font-size: 15px;
	}

	.arm-omp__works-list.is-long {
		column-count: 1;
	}

	.arm-omp__works {
		padding: 18px;
	}
}

@media (max-width: 420px) {
	.arm-oms__grid {
		--om-cols: 2;
	}
}

@media (prefers-reduced-motion: reduce) {
	.arm-om {
		animation: none;
	}

	.arm-om__frame,
	.arm-om__img,
	.arm-oms__dot {
		transition: none;
	}
}
