/* ==========================================================================
   Elite Dental Clinic — pages.css
   Treatment and doctor archives and detail pages, shared cards.
   Mobile-first; ≥810 / ≥1200 overrides in responsive.css.
   Measurements: docs/phase3-visual-audit.md
   ========================================================================== */

/* Archive sections ------------------------------------------------------- */

.archive-section {
	padding-bottom: var(--section-space-lg);
}

.archive-section > .card-grid,
.archive-section__empty {
	margin-top: var(--space-m);
}

.card-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--grid-gap);
}

/* Treatment card --------------------------------------------------------- */
/* A portrait photograph with an editorial caption beneath: index · category, title, summary, facts. */

.treatment-card__link {
	display: flex;
	flex-direction: column;
	color: inherit;
	text-decoration: none;
}

.treatment-card__media {
	aspect-ratio: 1;
}

.treatment-card__media img {
	transition: transform var(--duration-cinematic) var(--ease-editorial);
}

.treatment-card__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding-top: var(--space-s);
}

.treatment-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2xs) var(--space-s);
	margin: 0 0 var(--space-xs);
	font-family: var(--font-display);
	font-size: var(--text-small);
	line-height: var(--leading-snug);
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
	color: var(--edc-muted);
}

.treatment-card__text {
	max-width: 30rem;
	margin-top: var(--space-xs);
	color: var(--edc-text-soft);
}

.treatment-card__facts {
	margin-top: var(--space-xs);
	padding-top: var(--space-xs);
	border-top: var(--border-width) solid var(--edc-border);
	font-size: var(--text-small);
	color: var(--edc-muted);
}

.treatment-card__more {
	margin-top: var(--space-s);
}

/* Zoom on hover: mouse only, motion allowed. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
	.treatment-card__link:hover .treatment-card__media img,
	.treatment-card__link:focus-visible .treatment-card__media img {
		transform: scale(1.04);
	}
}

.treatment-card__link:focus-visible {
	outline-offset: 4px;
}

/* Treatments index: from tablet, two staggered columns (the second set lower), editorial rather than a card wall. */
@media (min-width: 37.5rem) {
	.card-grid--treatments:not(.card-grid--three) {
		--treatments-stagger: var(--space-3xl);
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: var(--space-s);
		row-gap: var(--space-xl);
		padding-bottom: var(--treatments-stagger);
	}

	.card-grid--treatments:not(.card-grid--three) > :nth-child(even) {
		position: relative;
		top: var(--treatments-stagger);
	}

	.card-grid--treatments:not(.card-grid--three) .treatment-card__media {
		aspect-ratio: 4 / 5;
	}
}

/* Wide screens: the 4:5 cards stop growing at 28rem; the zigzag opens out instead (odd left, even right). */
@media (min-width: 75rem) {
	.card-grid--treatments:not(.card-grid--three) > * {
		width: 100%;
		max-width: 28rem;
	}

	.card-grid--treatments:not(.card-grid--three) > :nth-child(even) {
		justify-self: end;
	}
}

/* Team: the three portraits share one row from tablet width. */
@media (min-width: 37.5rem) {
	.card-grid--doctors-three {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Four companion treatments on a tablet: two by two rather than three and an orphan. */
@media (min-width: 37.5rem) and (max-width: 50.6rem) {
	.card-grid--three:has(> :nth-child(4):last-child) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Smaller companion lists ("Other treatments", a doctor's treatments): as many columns as fit, then compact rows. */
.card-grid--three {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
	row-gap: var(--space-l);
}

.card-grid--three .treatment-card__title {
	font-size: var(--text-title);
	letter-spacing: var(--tracking-title);
}

@media (max-width: 37.49rem) {
	.card-grid--three .treatment-card__link {
		display: grid;
		grid-template-columns: 7.5rem minmax(0, 1fr);
		gap: var(--space-s);
		align-items: start;
	}

	.card-grid--three .treatment-card__media {
		aspect-ratio: 4 / 5;
	}

	.card-grid--three .treatment-card__body {
		padding-top: 0;
	}

	.card-grid--three .treatment-card__text {
		margin-top: var(--space-2xs);
		font-size: var(--text-small);
	}
}

/* Card "Read more" / "View profile" lines slide like a button when the card is hovered. */
:is(.treatment-card__link, .doctor-card__link, .journal-card__link, .next-article__link):is(:hover, :focus-visible) .button__line::before {
	transform: translateX(calc(100% + var(--button-line-gap)));
}

:is(.treatment-card__link, .doctor-card__link, .journal-card__link, .next-article__link):is(:hover, :focus-visible) .button__line::after {
	transform: none;
}

/* Doctor card ------------------------------------------------------------ */

.doctor-card__link {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	color: inherit;
	text-decoration: none;
}

.doctor-card__media {
	width: 100%;
	aspect-ratio: 4 / 5;
}

.doctor-card__name {
	margin-top: 0.625rem;
}

.doctor-card__role {
	margin-top: var(--space-3xs);
	color: var(--edc-text-soft);
}

.doctor-card__specialties {
	margin-top: var(--space-2xs);
	font-size: var(--text-small);
	color: var(--edc-muted);
}

.doctor-card__more {
	margin-top: var(--space-xs);
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
	.js .doctor-card__link:hover [data-reveal-image].is-revealed img {
		transform: scale(1.04);
	}
}

.doctor-card__link:focus-visible {
	outline-offset: 4px;
}

.card-grid--doctors,
.card-grid--doctors-compact {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	row-gap: var(--space-l);
}

.card-grid--doctors-three,
.card-grid--doctors-lead {
	row-gap: var(--space-l);
}

/* Homepage portrait names link to profiles. */
.doctor__name a {
	text-decoration: none;
}

.doctor__name a:hover {
	text-decoration: underline;
}

/* Detail hero (treatment) ------------------------------------------------ */

.detail-hero {
	position: relative;
	height: 24rem;
	overflow: hidden;
	background: var(--edc-dark);
	color: var(--edc-on-dark);
	isolation: isolate;
}

.detail-hero__media {
	position: absolute;
	inset: 0;
	z-index: -1;
}

.detail-hero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(0deg, color-mix(in srgb, var(--edc-dark) 55%, transparent) 0%, color-mix(in srgb, var(--edc-dark) 10%, transparent) 60%), linear-gradient(90deg, color-mix(in srgb, var(--edc-dark) 35%, transparent) 0%, transparent 60%);
}

.detail-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.detail-hero__inner {
	display: grid;
	align-items: end;
	height: 100%;
	padding-bottom: var(--space-m);
	column-gap: var(--grid-gap);
}

.detail-hero__content .eyebrow {
	margin-bottom: var(--space-xs);
}

/* Detail layout: sections + aside ---------------------------------------- */

.detail-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	column-gap: var(--grid-gap);
}

.detail-section {
	padding-block: var(--space-xl) 0;
}

.detail-section__label {
	margin-bottom: var(--space-m);
}

.detail-lead {
	font-size: var(--text-prose);
	line-height: var(--leading-body);
}

.detail-lead + .detail-prose {
	margin-top: 1.25em;
}

.detail-prose {
	font-size: var(--text-prose);
	line-height: var(--leading-body);
	color: var(--edc-text-soft);
}

.detail-prose > * + * {
	margin-top: 1.25em;
}

.detail-prose h2,
.detail-prose h3 {
	margin-top: 1.75em;
	color: var(--edc-text);
	font-size: var(--text-heading-sm);
	line-height: var(--leading-tight);
	letter-spacing: var(--tracking-display);
}

.detail-prose h3 {
	font-size: var(--text-title);
}

.detail-prose ul,
.detail-prose ol {
	padding-left: 1.25em;
}

.detail-aside {
	padding-block: var(--space-xl);
}

/* Facts ------------------------------------------------------------------ */

.facts {
	margin: 0;
	border-top: var(--border-width) solid var(--edc-border-strong);
}

/* Label | value rows on hairlines (stacked on phones), like a specification sheet. */
.facts__item {
	display: grid;
	gap: var(--space-3xs);
	padding-block: var(--space-s);
	border-bottom: var(--border-width) solid var(--edc-border);
}

@media (min-width: 37.5rem) {
	.facts__item {
		grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
		gap: var(--space-s);
		align-items: baseline;
	}
}

.facts__label {
	margin: 0;
	font-family: var(--font-display);
	font-size: var(--text-small);
	font-weight: 500;
	line-height: var(--leading-snug);
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
	color: var(--edc-muted);
}

.facts__value {
	margin: 0;
	font-family: var(--font-display);
	font-size: var(--text-feature);
	line-height: 1.4;
	letter-spacing: var(--tracking-heading);
}

.facts__list {
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var(--font-display);
	font-size: var(--text-feature);
	line-height: 1.4;
	letter-spacing: var(--tracking-heading);
}

.facts__list li + li {
	margin-top: var(--space-3xs);
}

/* Booking card ----------------------------------------------------------- */

.booking-card {
	border: var(--border-width) solid var(--edc-frame);
}

.booking-card__media {
	aspect-ratio: 1.83;
}

.booking-card__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: var(--space-xs);
}

.booking-card__title {
	font-size: 1.625rem;
	line-height: var(--leading-snug);
	letter-spacing: var(--tracking-heading);
}

.booking-card__text {
	margin-top: var(--space-xs);
	color: var(--edc-text-soft);
}

.booking-card .button--solid {
	margin-top: var(--space-m);
}

.booking-card__phone {
	margin-top: var(--space-s);
}

.profile-contact {
	margin: var(--space-xs) 0 0;
	padding: 0;
	list-style: none;
	color: var(--edc-text-soft);
}

.profile-contact a {
	overflow-wrap: anywhere;
	text-decoration: none;
}

.profile-contact a:hover {
	text-decoration: underline;
}

/* Profile hero (doctor) -------------------------------------------------- */

.profile-hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-m) var(--grid-gap);
	padding-top: calc(var(--header-height) + var(--space-m));
}

.profile-hero__media {
	order: -1;
	aspect-ratio: 1;
}

/* Tablet: copy beside the portrait, not a screen-wide face (desktop places both on the 12-column grid). */
@media (min-width: 37.5rem) {
	.profile-hero {
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
		align-items: end;
	}

	.profile-hero__copy {
		grid-row: 1;
	}

	.profile-hero__media {
		grid-row: 1;
		order: 0;
	}
}

.profile-hero__title {
	margin-top: var(--space-xs);
}

.profile-hero__lede {
	max-width: 32rem;
	margin-top: var(--space-s);
}

.profile-hero__meta {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-s);
	margin: var(--space-m) 0 0;
}

.profile-hero__meta dt {
	font-family: var(--font-display);
	font-size: var(--text-small);
	font-weight: 500;
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
	color: var(--edc-muted);
}

.profile-hero__meta dd {
	margin: var(--space-3xs) 0 0;
}
