/* ==========================================================================
   SL8 Management — Residents (page-residents.php)
   Only what is unique to this page. Shared components live in base.css.
   Desktop rules first, phone overrides in @media (max-width: 899.98px),
   motion at the end inside @media (prefers-reduced-motion: no-preference).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Hero: headline left, paragraph right, on the photograph
   -------------------------------------------------------------------------- */

.sl8-residents-hero {
	--sl8-hero-min: 540px;
	--sl8-hero-min-phone: 440px;
	--sl8-hero-pos: 50% 56%;
	--sl8-hero-pos-phone: 50% 56%;
}

/* 164 = the doors' 104px overlap + 60px of air above them */
.sl8-residents-hero__inner {
	gap: 32px 80px;
	padding-top: 72px;
	padding-bottom: 164px;
}

.sl8-residents-hero__title {
	flex: 1 1 420px;
	min-width: 0;
}

.sl8-residents-hero__lead {
	flex: 0 1 560px;
	min-width: 0;
	font-size: 20px;
	line-height: 32px;
	color: var(--on-ink);
}

/* --------------------------------------------------------------------------
   2. The three doors: one bordered block straddling the photograph's edge
   -------------------------------------------------------------------------- */

.sl8-residents-doors-band {
	position: relative;
	z-index: 3;
	display: flow-root;
	background: var(--paper);
}

.sl8-residents-doors {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin-top: -104px;
	background: var(--paper);
	border: 1px solid var(--ink);
}

/* label, title, rule on top; the arrow pinned to the bottom */
.sl8-residents-door {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: auto auto auto 1fr;
	min-height: 296px;
	padding: 30px 32px 28px;
	color: var(--ink);
	text-decoration: none;
}

.sl8-residents-door + .sl8-residents-door {
	border-left: 1px solid var(--ink);
}

.sl8-residents-door__label {
	grid-row: 1;
	color: inherit;
}

.sl8-residents-door__title {
	grid-row: 2;
	display: block;
	margin-top: 20px;
	font-size: clamp(34px, 3.9vw, 56px);
	line-height: 0.98;
	letter-spacing: -0.04em;
	font-weight: 300;
	overflow-wrap: break-word;
}

.sl8-residents-door--primary .sl8-residents-door__title {
	font-weight: 600;
}

.sl8-residents-door__rule {
	grid-row: 3;
	display: block;
	width: 64px;
	height: 2px;
	margin-top: 20px;
	background: var(--accent);
}

.sl8-residents-door__arrow {
	grid-row: 4;
	align-self: end;
	width: 40px;
	height: 40px;
	margin-top: 40px;
}

.sl8-residents-door:hover {
	background: var(--ink);
	color: var(--on-ink);
	--sl8-focus: var(--on-ink);
}

.sl8-residents-door:hover .sl8-residents-door__rule {
	background: var(--accent-on-ink);
}

.sl8-residents-door:focus-visible {
	outline-offset: -6px;
}

/* --------------------------------------------------------------------------
   3. Section spacing (the artboard draws 112 / 120 on these four bands)
   -------------------------------------------------------------------------- */

.sl8-residents-maintenance,
.sl8-residents-mybos,
.sl8-residents-office,
.sl8-residents-faq {
	padding: 112px 0 120px;
}

/* --------------------------------------------------------------------------
   4. Maintenance request: the form on its sand block
   -------------------------------------------------------------------------- */

.sl8-residents-form {
	margin-top: 56px;
	padding: 56px 64px;
	background: var(--sand);
}

.sl8-residents-form__grid {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 32px 64px;
}

.sl8-residents-form__fields {
	flex: 1.35 1 440px;
	min-width: 0;
	align-content: flex-start;
}

.sl8-residents-form__fields > .sl8-residents-form__unit {
	flex: 1 1 140px;
}

.sl8-residents-form__fields > .sl8-residents-form__name {
	flex: 2 1 240px;
}

/* "Photos help": the dashed paper drop for photographs */
.sl8-residents-upload {
	flex: 1 1 300px;
	min-width: 0;
	min-height: 240px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 32px;
	padding: 28px 28px 22px;
	background: var(--paper);
	border: 1.5px dashed var(--stone);
	border-radius: var(--radius);
}

.sl8-residents-upload__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
}

.sl8-residents-upload__label {
	font-size: 32px;
	line-height: 36px;
	letter-spacing: -0.03em;
	font-weight: 500;
}

.sl8-residents-upload__icon {
	width: 32px;
	height: 32px;
}

.sl8-residents-upload__input {
	display: block;
	width: 100%;
	min-height: 44px;
	padding: 9px 0;
	font-family: var(--font);
	font-size: 15px;
	line-height: 24px;
	color: var(--stone);
}

.sl8-residents-form__submit {
	margin-top: 32px;
}

.sl8-residents-form__note {
	margin-top: 16px;
}

/* --------------------------------------------------------------------------
   5. MyBOS: the one ink band
   -------------------------------------------------------------------------- */

.sl8-residents-mybos__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 48px 96px;
}

.sl8-residents-mybos__head {
	flex: 1 1 520px;
	min-width: 0;
}

.sl8-residents-mybos__title {
	margin-top: 20px;
	font-size: clamp(88px, 13.2vw, 190px);
	line-height: 0.86;
	letter-spacing: -0.055em;
	font-weight: 300;
}

.sl8-residents-mybos__aside {
	flex: 0 1 400px;
	min-width: 0;
}

.sl8-residents-mybos__lede {
	padding-top: 28px;
	border-top: 1px solid var(--ink-line);
	font-size: 32px;
	line-height: 40px;
	letter-spacing: -0.025em;
	font-weight: 500;
}

.sl8-residents-mybos__link {
	margin-top: 28px;
}

.sl8-residents-mybos__note {
	margin-top: 16px;
	font-size: 15px;
	line-height: 23px;
	color: var(--on-ink-2);
}

/* --------------------------------------------------------------------------
   6. Office hours: the hours, the office, then the team
   -------------------------------------------------------------------------- */

.sl8-residents-hours {
	margin-top: 56px;
	padding-top: 36px;
	border-top: 1px solid var(--ink);
}

.sl8-residents-hours__text {
	min-width: 0;
	font-size: clamp(56px, 7.6vw, 110px);
	line-height: 0.93;
	letter-spacing: -0.05em;
	font-weight: 300;
}

.sl8-residents-hours__text > span {
	display: block;
}

.sl8-residents-hours__strong {
	font-weight: 600;
}

.sl8-residents-nowrap {
	white-space: nowrap;
}

/* the accent rule under the hours is drawn on phones only */
.sl8-residents-hours__rule {
	display: block;
	width: 64px;
	height: 2px;
	margin-top: 22px;
	background: var(--accent);
}

.sl8-residents-office__row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 56px 96px;
	margin-top: 80px;
}

.sl8-residents-office__media {
	flex: 0 1 480px;
	min-width: 0;
}

.sl8-residents-office__media img {
	height: 500px;
	object-position: 45% 50%;
}

.sl8-residents-office__info {
	flex: 1 1 480px;
	min-width: 0;
	align-self: stretch;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 48px;
}

.sl8-residents-office__statement {
	font-size: 32px;
	line-height: 42px;
	letter-spacing: -0.025em;
	font-weight: 500;
	text-wrap: balance;
}

/* phone, email and address as three ruled rows */
.sl8-residents-contact {
	border-top: 1px solid var(--ink);
}

.sl8-residents-contact__link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	color: var(--ink);
	text-decoration: none;
}

.sl8-residents-contact__link:hover {
	color: var(--stone);
}

.sl8-residents-contact__link--phone {
	min-height: 120px;
	font-size: clamp(44px, 5vw, 72px);
	line-height: 1;
	letter-spacing: -0.045em;
	font-weight: 300;
}

.sl8-residents-contact__link--email {
	min-height: 96px;
	border-top: 1px solid var(--line);
	font-size: clamp(24px, 2.7vw, 38px);
	line-height: 1.1;
	letter-spacing: -0.02em;
	font-weight: 400;
}

.sl8-residents-contact__link--email > span {
	min-width: 0;
	overflow-wrap: anywhere;
}

.sl8-residents-contact__arrow {
	width: 28px;
	height: 28px;
}

.sl8-residents-contact__address {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 20px;
	padding-top: 24px;
	border-top: 1px solid var(--line);
}

.sl8-residents-contact__address .sl8-label {
	flex: none;
}

.sl8-residents-contact__street {
	font-size: 18px;
	line-height: 26px;
	font-weight: 500;
	text-align: right;
}

.sl8-residents-team {
	margin-top: 72px;
}

/* --------------------------------------------------------------------------
   7. Recently in the building: heading and link on one line, then the
      five newest newsletters as dated items on a six-column grid (2-2-2,
      then 3-3). The link follows the list in the markup (its phone
      position) and is ordered up here.
   -------------------------------------------------------------------------- */

.sl8-residents-news__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 32px;
}

.sl8-residents-news__title {
	order: 1;
	min-width: 0;
}

.sl8-residents-news__more {
	order: 2;
}

/* 40 + the 16px row gap = the 56 drawn under the heading */
.sl8-residents-news__list {
	order: 3;
	flex: 0 0 100%;
	min-width: 0;
	margin-top: 40px;
	grid-template-columns: repeat(6, minmax(0, 1fr));
}

.sl8-residents-news__list > .sl8-news-item {
	grid-column: span 2;
}

/* the fourth and fifth newsletters share the second row */
.sl8-residents-news__list > .sl8-news-item:nth-child(n+4) {
	grid-column: span 3;
}

/* the issue's photograph, 120 x 90 (or its first page, from the top) */
.sl8-residents-news__thumb {
	width: 120px;
	height: 90px;
}

.sl8-residents-news__thumb--page {
	object-position: top;
}

/* the issue's other headlines, joined with " · " */
.sl8-residents-news__others {
	margin-top: 8px;
	font-size: 14px;
	line-height: 21px;
	color: var(--stone);
}

/* "<Month YYYY> Newsletter" opens the PDF in a new tab */
.sl8-residents-news__link {
	gap: 8px;
	margin-top: 2px;
	text-underline-offset: 5px;
}

/* --------------------------------------------------------------------------
   8. FAQs: heading left, accordion right
   -------------------------------------------------------------------------- */

.sl8-residents-faq__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 48px 96px;
}

.sl8-residents-faq__title {
	flex: 1 1 380px;
	min-width: 0;
}

.sl8-residents-faq__list {
	flex: 1.6 1 560px;
	min-width: 0;
	max-width: 820px;
}

/* --------------------------------------------------------------------------
   9. Phones
   -------------------------------------------------------------------------- */

@media (max-width: 899.98px) {
	/* Hero */
	.sl8-residents-hero__inner {
		gap: 20px;
		padding-top: 48px;
		padding-bottom: 72px;
	}

	.sl8-residents-hero__title {
		flex: 0 0 auto;
		font-size: 44px;
		line-height: 42px;
	}

	.sl8-residents-hero__lead {
		flex: 0 0 auto;
		font-size: 16px;
		line-height: 25px;
	}

	/* Doors: stacked; label and arrow on top, the title at the bottom */
	.sl8-residents-doors {
		display: flex;
		flex-direction: column;
		margin-top: -40px;
	}

	.sl8-residents-door {
		grid-template-columns: minmax(0, 1fr) 30px;
		grid-template-rows: auto 1fr auto auto;
		column-gap: 16px;
		min-height: 200px;
		padding: 20px 20px 22px;
	}

	.sl8-residents-door + .sl8-residents-door {
		border-left: 0;
		border-top: 1px solid var(--ink);
	}

	.sl8-residents-door__label {
		grid-area: 1 / 1 / 2 / 2;
		padding-top: 4px;
	}

	.sl8-residents-door__arrow {
		grid-area: 1 / 2 / 2 / 3;
		align-self: start;
		width: 30px;
		height: 30px;
		margin-top: 0;
		stroke-width: 1;
	}

	.sl8-residents-door__title {
		grid-area: 3 / 1 / 4 / 3;
		margin-top: 16px;
		/* 44 as drawn; eases down under 340px so "Maintenance" stays on one line */
		font-size: min(44px, 13vw);
		line-height: 42px;
	}

	.sl8-residents-door__rule {
		grid-area: 4 / 1 / 5 / 3;
		margin-top: 14px;
	}

	/* no fill on touch */
	.sl8-residents-door:hover {
		background: transparent;
		color: var(--ink);
		--sl8-focus: var(--ink);
	}

	.sl8-residents-door:hover .sl8-residents-door__rule {
		background: var(--accent);
	}

	/* Section spacing */
	.sl8-residents-maintenance {
		padding: 56px 0 0;
	}

	.sl8-residents-mybos {
		padding: 56px 0 60px;
	}

	.sl8-residents-office,
	.sl8-residents-faq {
		padding: 56px 0;
	}

	.sl8-residents-news {
		padding: 56px 0 44px;
	}

	/* Maintenance: the sand block runs edge to edge and meets the ink band */
	.sl8-residents-form {
		margin: 32px -20px 0;
		padding: 32px 20px 36px;
	}

	.sl8-residents-form__grid {
		flex-direction: column;
		flex-wrap: nowrap;
		gap: 16px;
	}

	.sl8-residents-form__fields {
		flex: 0 0 auto;
		gap: 16px;
	}

	.sl8-residents-form__fields > .sl8-residents-form__unit,
	.sl8-residents-form__fields > .sl8-residents-form__name {
		flex: 0 0 auto;
	}

	.sl8-residents-upload {
		flex: 0 0 auto;
		min-height: 0;
		justify-content: flex-start;
		gap: 8px;
		padding: 18px 20px 14px;
	}

	.sl8-residents-upload__head {
		align-items: center;
		gap: 16px;
	}

	.sl8-residents-upload__label {
		display: flex;
		align-items: center;
		min-height: 44px;
		font-size: 28px;
		line-height: 32px;
	}

	.sl8-residents-upload__icon {
		width: 26px;
		height: 26px;
	}

	.sl8-residents-form__submit {
		height: auto;
		min-height: 58px;
		margin-top: 20px;
		padding: 8px 20px;
		font-size: 17px;
		line-height: 22px;
		white-space: normal;
	}

	.sl8-residents-form__note {
		margin-top: 14px;
	}

	/* MyBOS */
	.sl8-residents-mybos__inner {
		display: block;
	}

	.sl8-residents-mybos__title {
		margin-top: 14px;
		/* 104 as drawn; eases down under 365px so the word never overflows */
		font-size: min(104px, 28.5vw);
		line-height: 90px;
	}

	.sl8-residents-mybos__aside {
		margin-top: 36px;
	}

	.sl8-residents-mybos__lede {
		padding-top: 22px;
		font-size: 26px;
		line-height: 32px;
	}

	.sl8-residents-mybos__link {
		margin-top: 22px;
	}

	/* Office hours: hours, photograph, team, statement, contact rows */
	.sl8-residents-hours {
		margin-top: 32px;
		padding-top: 24px;
	}

	.sl8-residents-hours__text {
		font-size: 56px;
		line-height: 52px;
	}

	.sl8-residents-office__body {
		display: flex;
		flex-direction: column;
	}

	.sl8-residents-office__row,
	.sl8-residents-office__info {
		display: contents;
	}

	.sl8-residents-office__photo {
		order: 1;
		width: 100%;
		height: 240px;
		margin-top: 36px;
		object-fit: cover;
		object-position: 62% 50%;
	}

	.sl8-residents-team {
		order: 2;
		margin-top: 28px;
	}

	.sl8-residents-office__statement {
		order: 3;
		margin-top: 40px;
		font-size: 26px;
		line-height: 33px;
	}

	.sl8-residents-contact {
		order: 4;
		margin-top: 32px;
	}

	.sl8-residents-contact__link {
		gap: 16px;
	}

	.sl8-residents-contact__link--phone {
		min-height: 96px;
		/* 48 as drawn; eases down under 358px so the unbroken number fits */
		font-size: min(48px, 13.4vw);
		line-height: 48px;
		white-space: nowrap;
	}

	.sl8-residents-contact__link--email {
		min-height: 72px;
		font-size: 21px;
		line-height: 26px;
	}

	.sl8-residents-contact__arrow {
		width: 24px;
		height: 24px;
	}

	.sl8-residents-contact__address {
		display: block;
		padding-top: 20px;
	}

	.sl8-residents-contact__street {
		margin-top: 6px;
		text-align: left;
	}

	/* Recently in the building: heading, items, then the News link */
	.sl8-residents-news__inner {
		display: block;
	}

	.sl8-residents-news__list {
		margin-top: 32px;
	}

	.sl8-residents-news__thumb {
		width: 96px;
		height: 72px;
	}

	.sl8-residents-news__more {
		margin-top: 12px;
	}

	/* FAQs */
	.sl8-residents-faq__inner {
		display: block;
	}

	.sl8-residents-faq__list {
		max-width: none;
		margin-top: 32px;
	}
}

/* --------------------------------------------------------------------------
   10. Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
	.sl8-residents-door {
		transition: background-color .25s, color .25s;
	}

	.sl8-residents-door__rule {
		transition: background-color .25s;
	}

	/* on phones the doors rise with the hero lines (the artboard's fourth beat) */
	@media (max-width: 899.98px) {
		.sl8-residents-doors {
			animation: sl8-rise-phone 1s var(--ease) .42s both;
		}
	}
}
