/*
 * Subscriptions page — page-subscriptions.php.
 *
 * Only this page's own bands are styled here. The plan cards are the shared
 * .card component from assets/css/cards.css and the buttons are the shared
 * .hcr-btn rules, so neither is re-declared: this file adds the plan grid, the
 * featured treatment and the perks list on top of them. Every colour, size,
 * space, radius, shadow and duration is a design token, so a
 * [data-theme="dark"] remap of the role tokens recolours the page with no
 * extra rules here.
 *
 * Mobile-first: one column, the plans becoming three columns at 48em (tablet).
 */

.hcr-subs {
	background: var(--color-bg);
	color: var(--color-text);
}

/* --------------------------------------------------------------- the hero --- */

/*
 * A real photograph with the design system's hero gradient over it, so the
 * headline stays legible rather than sitting on a flat colour band.
 */
.hcr-subs__hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding-block: var(--space-section);
	background: var(--color-surface-dark);
	color: var(--color-neutral-50);
}

.hcr-subs__hero-image {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hcr-subs__hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--overlay-hero);
}

.hcr-subs__hero-inner {
	position: relative;
	max-width: var(--container-narrow);
	margin-inline: auto;
}

.hcr-subs__eyebrow {
	margin: 0 0 var(--space-3);
	color: var(--color-accent-300);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	letter-spacing: var(--letter-wide);
	text-transform: uppercase;
}

.hcr-subs__title {
	margin: 0;
	font-family: var(--font-heading);
	font-size: var(--text-4xl);
	font-weight: var(--weight-bold);
	letter-spacing: var(--letter-tighter);
	line-height: var(--leading-tight);
	text-wrap: balance;
}

.hcr-subs__lede {
	margin: var(--space-5) 0 0;
	max-width: var(--measure);
	color: var(--color-neutral-200);
	font-family: var(--font-body);
	font-size: var(--text-lg);
	line-height: var(--leading-normal);
}

.hcr-subs__hero-actions {
	margin: var(--space-8) 0 0;
}

/* -------------------------------------------------------------- the plans --- */

/*
 * The warm cream band the cards sit on, so the plans read as their own section
 * against the hero above and the page background below.
 */
.hcr-subs__plans {
	background: var(--color-surface);
	scroll-margin-top: var(--header-height);
}

.hcr-subs__heading {
	margin: 0;
	font-family: var(--font-heading);
	font-size: var(--text-3xl);
	font-weight: var(--weight-bold);
	letter-spacing: var(--letter-tight);
	line-height: var(--leading-snug);
	text-wrap: balance;
}

.hcr-subs__intro {
	margin: var(--space-4) 0 0;
	max-width: var(--measure);
	color: var(--color-text-muted);
	font-family: var(--font-body);
	font-size: var(--text-base);
	line-height: var(--leading-normal);
}

.hcr-subs__empty {
	margin: var(--space-8) 0 0;
	padding: var(--space-8);
	border: var(--border-width) dashed var(--color-border);
	border-radius: var(--radius-lg);
	background: var(--color-bg);
	color: var(--color-text-muted);
	font-family: var(--font-body);
	font-size: var(--text-lg);
	text-align: center;
}

/*
 * One column on mobile, three from tablet width up. The shared .card-grid goes
 * to two columns at 40em, which would leave a single plan stranded on a second
 * row, so the three plans keep one column until 48em and then take a column
 * each.
 */
.hcr-subs__grid {
	margin-top: var(--space-10);
	align-items: start;
}

@media (min-width: 40em) {
	.hcr-subs__grid {
		grid-template-columns: 1fr;
	}
}

@media (min-width: 48em) {
	.hcr-subs__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 64em) {
	.hcr-subs__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: var(--space-8);
	}
}

/* --------------------------------------------------------- the plan cards --- */

.card--plan {
	height: 100%;
}

.card--plan .card__body {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
}

.card--plan .card__meta {
	color: var(--color-primary-700);
	font-weight: var(--weight-medium);
}

.card--plan .card__price {
	margin-block: var(--space-2);
	font-family: var(--font-heading);
	font-size: var(--text-2xl);
	font-weight: var(--weight-bold);
	letter-spacing: var(--letter-tight);
}

.card--plan .card__price-note {
	color: var(--color-text-muted);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	font-weight: var(--weight-regular);
	letter-spacing: var(--letter-normal);
}

.card--plan .card__footer {
	display: flex;
	flex-direction: column;
	gap: var(--space-5);
	margin-top: auto;
	padding-top: var(--space-2);
}

.card__perks {
	display: grid;
	gap: var(--space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.card__perk {
	display: flex;
	gap: var(--space-3);
	align-items: flex-start;
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	line-height: var(--leading-normal);
}

.card__perk-tick {
	flex: 0 0 auto;
	color: var(--color-primary-600);
	font-weight: var(--weight-bold);
}

.card__plan-btn {
	width: 100%;
	justify-content: center;
	text-align: center;
}

/* ----------------------------------------------------- the featured plan --- */

/*
 * The copper ring, the deeper shadow and the slight lift are the only things
 * that mark the featured plan; the badge text itself comes from the plan data.
 */
.card--plan-featured {
	border-color: var(--color-primary-600);
	box-shadow: var(--shadow-lg);
	outline: var(--border-width) solid var(--color-primary-600);
	outline-offset: calc(var(--border-width) * -2);
}

.card--plan-featured .card__badge {
	background: var(--color-primary-600);
	color: var(--color-on-primary);
}

.card--plan-featured .card__title {
	color: var(--color-primary-700);
}

@media (min-width: 48em) {
	.card--plan-featured {
		transform: translateY(calc(var(--space-2) * -1));
	}
}

@media (prefers-reduced-motion: reduce) {
	.card--plan-featured {
		transform: none;
	}
}

/* ----------------------------------------------------- how it works ------- */

/*
 * The step flow sits on the page background, so it reads as its own band
 * between the cream plans band above and whatever follows below. Both colours
 * are role tokens, so a [data-theme="dark"] remap recolours it with no extra
 * rules.
 *
 * Mobile-first: the ordered list is a single column, becoming two columns at
 * 40em and a four-across row at 64em. The numerals are rendered in the markup
 * (not by a CSS counter) so they survive with styles off.
 */

.hcr-steps {
	background: var(--color-bg);
	color: var(--color-text);
	scroll-margin-top: var(--header-height);
}

.hcr-steps__list {
	display: grid;
	gap: var(--space-8);
	margin: var(--space-10) 0 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 40em) {
	.hcr-steps__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--space-10) var(--space-8);
	}
}

@media (min-width: 64em) {
	.hcr-steps__list {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/*
 * One step. The hairline above each item draws the flow across the row on
 * desktop without needing a decorative connector element.
 */
.hcr-steps__item {
	padding-top: var(--space-5);
	border-top: var(--border-width) solid var(--color-border);
}

.hcr-steps__mark {
	display: flex;
	gap: var(--space-3);
	align-items: center;
	margin: 0 0 var(--space-4);
	color: var(--color-primary-600);
}

.hcr-steps__numeral {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: var(--space-10);
	height: var(--space-10);
	border-radius: var(--radius-full);
	background: var(--color-primary-600);
	color: var(--color-on-primary);
	font-family: var(--font-heading);
	font-size: var(--text-lg);
	font-weight: var(--weight-bold);
	letter-spacing: var(--letter-normal);
	line-height: 1;
}

.hcr-steps__icon {
	flex: 0 0 auto;
	color: var(--color-accent-600);
}

.hcr-steps__title {
	margin: 0;
	font-family: var(--font-heading);
	font-size: var(--text-lg);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--letter-tight);
	line-height: var(--leading-snug);
	text-wrap: balance;
}

.hcr-steps__text {
	margin: var(--space-3) 0 0;
	max-width: var(--measure);
	color: var(--color-text-muted);
	font-family: var(--font-body);
	font-size: var(--text-base);
	line-height: var(--leading-normal);
}

/* --------------------------------------------- manage, pause and cancel --- */

/*
 * "Change, skip or cancel anytime" — template-parts/subscriptions/manage-cancel.php.
 *
 * An asymmetric split: the reassurance copy and the Contact link on one side,
 * the native details/summary disclosures on the other, so this band does not
 * repeat the centred-text rhythm of the sections above it. A warm surface
 * background separates it from the steps. No JavaScript is involved — the open
 * and closed states are the browser's own, and the chevron is a pseudo-element.
 */
.hcr-manage {
	background: var(--color-surface);
	color: var(--color-text);
}

.hcr-manage__inner {
	display: grid;
	gap: var(--space-10);
}

@media (min-width: 64em) {
	.hcr-manage__inner {
		grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
		gap: var(--space-16);
		align-items: start;
	}

	.hcr-manage__intro {
		position: sticky;
		top: var(--space-8);
	}
}

.hcr-manage__lede {
	max-width: var(--measure);
}

.hcr-manage__help {
	margin: var(--space-6) 0 0;
	max-width: var(--measure);
	color: var(--color-text-muted);
	font-family: var(--font-body);
	font-size: var(--text-base);
	line-height: var(--leading-normal);
}

.hcr-manage__actions {
	margin: var(--space-5) 0 0;
}

/* The disclosures. */

.hcr-manage__list {
	display: grid;
	gap: var(--space-4);
}

.hcr-manage__item {
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-lg);
	background: var(--color-bg);
	box-shadow: var(--shadow-sm);
	transition: box-shadow var(--duration-normal) var(--ease-default),
		border-color var(--duration-normal) var(--ease-default);
}

.hcr-manage__item:hover {
	border-color: var(--color-primary-300);
	box-shadow: var(--shadow-md);
}

.hcr-manage__item[open] {
	border-color: var(--color-primary-300);
	box-shadow: var(--shadow-md);
}

/*
 * The clickable row. The default disclosure triangle is removed in both the
 * WebKit and the standards way and replaced with a copper chevron that rotates
 * when the item is open.
 */
.hcr-manage__summary {
	display: flex;
	gap: var(--space-4);
	align-items: center;
	justify-content: space-between;
	padding: var(--space-5) var(--space-6);
	cursor: pointer;
	color: var(--color-text);
	font-family: var(--font-heading);
	font-size: var(--text-base);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--letter-tight);
	line-height: var(--leading-snug);
	list-style: none;
}

.hcr-manage__summary::-webkit-details-marker {
	display: none;
}

.hcr-manage__summary::after {
	content: "";
	flex: 0 0 auto;
	width: var(--space-3);
	height: var(--space-3);
	border-right: var(--border-width) solid currentColor;
	border-bottom: var(--border-width) solid currentColor;
	color: var(--color-primary-600);
	transform: rotate(45deg);
	transform-origin: center;
	transition: transform var(--duration-normal) var(--ease-default);
}

.hcr-manage__item[open] > .hcr-manage__summary::after {
	transform: rotate(-135deg);
}

.hcr-manage__summary:hover {
	color: var(--color-primary-700);
}

/* A visible keyboard focus ring on the row itself, not just the text. */
.hcr-manage__summary:focus-visible {
	outline: var(--space-1) solid var(--color-primary-600);
	outline-offset: calc(var(--space-1) * -1);
	border-radius: var(--radius-lg);
}

.hcr-manage__panel {
	padding: 0 var(--space-6) var(--space-6);
}

.hcr-manage__text {
	margin: 0;
	max-width: var(--measure);
	color: var(--color-text-muted);
	font-family: var(--font-body);
	font-size: var(--text-base);
	line-height: var(--leading-normal);
}

.hcr-manage__points {
	margin: var(--space-4) 0 0;
	padding: 0;
	display: grid;
	gap: var(--space-2);
	list-style: none;
}

.hcr-manage__point {
	display: flex;
	gap: var(--space-3);
	align-items: flex-start;
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	line-height: var(--leading-normal);
}

.hcr-manage__point-tick {
	flex: 0 0 auto;
	color: var(--color-primary-600);
	font-weight: var(--weight-bold);
}

/* ---------------------------------------------- the subscribe CTA band --- */

/*
 * A full-width, contrasting band closing the page: the dark surface token with
 * a real photograph and the design system's hero gradient over it, so it reads
 * as a deliberate change of pace after the light manage/cancel section. Every
 * colour is a role or neutral token, so a dark-theme remap keeps it readable.
 */
.hcr-subscribe {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding-block: var(--space-section);
	background: var(--color-surface-dark);
	color: var(--color-neutral-50);
	text-align: center;
}

.hcr-subscribe__image {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hcr-subscribe::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--overlay-hero), var(--overlay-flat);
}

.hcr-subscribe__inner {
	position: relative;
	max-width: var(--container-narrow);
	margin-inline: auto;
}

.hcr-subscribe__eyebrow {
	margin: 0 0 var(--space-3);
	color: var(--color-accent-300);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	letter-spacing: var(--letter-wide);
	text-transform: uppercase;
}

.hcr-subscribe__heading {
	margin: 0;
	color: var(--color-neutral-50);
	font-family: var(--font-heading);
	font-size: var(--text-3xl);
	font-weight: var(--weight-bold);
	letter-spacing: var(--letter-tight);
	line-height: var(--leading-tight);
	text-wrap: balance;
}

.hcr-subscribe__text {
	margin: var(--space-4) auto 0;
	max-width: var(--measure);
	color: var(--color-neutral-200);
	font-family: var(--font-body);
	font-size: var(--text-lg);
	line-height: var(--leading-normal);
}

.hcr-subscribe__actions {
	margin: var(--space-8) 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-4);
	align-items: center;
	justify-content: center;
}

/* The primary action is the biggest thing in the band. */
.hcr-subscribe__btn {
	padding: var(--space-4) var(--space-8);
	font-size: var(--text-lg);
	font-weight: var(--weight-semibold);
	box-shadow: var(--shadow-lg);
	transition:
		background var(--duration-fast) var(--ease-default),
		transform var(--duration-normal) var(--ease-default),
		box-shadow var(--duration-normal) var(--ease-default);
}

.hcr-subscribe__btn:hover,
.hcr-subscribe__btn:focus-visible {
	transform: translateY(-2px);
	box-shadow: var(--shadow-xl);
}

/*
 * The quiet button's light background would disappear on the dark band, so it
 * becomes an outline in the band's own foreground colour.
 */
.hcr-subscribe__compare {
	background: transparent;
	border-color: var(--color-neutral-400);
	color: var(--color-neutral-50);
	font-size: var(--text-base);
	padding: var(--space-3) var(--space-5);
}

.hcr-subscribe__compare:hover,
.hcr-subscribe__compare:focus-visible {
	background: rgba(250, 250, 249, 0.12);
	border-color: var(--color-neutral-50);
	color: var(--color-neutral-50);
}

/* A visible keyboard focus ring on both actions, against the dark band. */
.hcr-subscribe__btn:focus-visible,
.hcr-subscribe__compare:focus-visible {
	outline: var(--space-1) solid var(--color-accent-300);
	outline-offset: var(--space-1);
}

.hcr-subscribe__note {
	margin: var(--space-6) auto 0;
	max-width: var(--measure);
	color: var(--color-neutral-300);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	line-height: var(--leading-normal);
}

@media (prefers-reduced-motion: reduce) {
	.hcr-subscribe__btn:hover,
	.hcr-subscribe__btn:focus-visible {
		transform: none;
	}
}
