/**
 * Card block.
 *
 * Figma: PAC-Page-Designs, page "Home Page", inside "Info 4 card row"
 *   1440px  node I2001:1574;6082:2020  (card 410.67 x 481.78)
 *    390px  node I2001:2049;6171:3351  (card 350 x 433.33)
 *
 * The card has two layouts. Below 768 and from 1024 up it is vertical, with
 * the photograph on top. Between those - and only there - it turns on its
 * side: the photograph goes left at a fixed 320px and the text sits beside
 * it. That is why the rule below is a range rather than the usual min-width;
 * writing it mobile-first would mean setting the horizontal layout at 768 and
 * then undoing every part of it at 1024, which reads as two bugs cancelling
 * out rather than as one deliberate shape.
 *
 * How many cards share a row, and the gaps between them, belong to
 * blocks/card-row/style.css.
 */

.pchs-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--lg); /* 24px */
	background-color: var(--wp--preset--color--white);
	box-shadow: var(--wp--preset--shadow--lg);
	transition: background-color 0.2s ease;
}

/*
 * HOVERED: THE CARD DROPS TO ITS OWN HEIGHT.
 *
 * Cards in a row are all as tall as the tallest, so most of them carry
 * empty space under their text with the arrow parked at the very bottom
 * of it. Hovered, the card stops sharing that height and becomes as tall
 * as its own contents - which is the "shrink" in the design, and it
 * brings the arrow up to sit under the words rather than far below them.
 *
 * `height: fit-content` rather than `align-self`, because align-self acts
 * on the CROSS axis: where the row stacks - below 768 and between 768 and
 * 1023 - the cross axis is the width, and the card would have narrowed
 * instead of shortened. An explicit height overrides the stretch wherever
 * the stretch happens to be, and is simply the natural height everywhere
 * else.
 *
 * Nothing moves that a neighbour can see: the row's height comes from the
 * tallest card's natural height, which this does not change, so the cards
 * either side stay exactly where they are.
 */
.pchs-card:hover {
	height: fit-content;
	background-color: var(--wp--preset--color--gray-300);
}

/*
 * Once view.js is running it owns the height, so that the change can be
 * animated rather than arriving in one frame - and the rule above would
 * otherwise get there first, leaving the script measuring the same
 * height at both ends and doing nothing. The row is marked only by the
 * script, so a browser without it keeps the plain rule above.
 */
.pchs-card-row--animated .pchs-card:hover {
	height: auto;
}

.pchs-card__media {
	position: relative;
	width: 100%;
	/* The frame crops every card photograph to this ratio rather
	   than letting each image keep its own proportions, so a row
	   of cards lines up however the pictures were shot. */
	aspect-ratio: 300 / 200;
	flex-shrink: 0;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--lg);
	box-shadow: var(--wp--preset--shadow--md);
}

.pchs-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* Set per card by the editor's focal point picker, so a face
	   is not cropped out when a tall photograph is squared off. */
	object-position: var(--pchs-card-focal, 50% 50%);
}

.pchs-card__info {
	display: flex;
	width: 100%;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--4);
	/* The deep bottom padding leaves room for the arrow, which is
	   positioned over the card rather than sitting in the flow. */
	padding: var(--wp--preset--spacing--24) var(--wp--preset--spacing--24) 48px;
}

.pchs-card__title {
	margin: 0;
	color: var(--wp--preset--color--blue-500);
	font-family: var(--wp--preset--font-family--navigation);
	font-size: var(--wp--preset--font-size--md); /* 16px */
	font-weight: 500;
	line-height: 19px; /* 16 x 1.2, rounded as Figma rounds it */
	letter-spacing: var(--wp--custom--tracking--normal);
}

/* The link covers the whole card while remaining a single link
   named by the title. Anything that needs to sit above it - the
   arrow, say - needs its own stacking context. */
.pchs-card__link {
	color: inherit;
	text-decoration: none;
}

/*
 * THE TITLE KEEPS ITS COLOUR WHEN HOVERED; only the underline arrives.
 *
 * theme.json gives every link in the theme a blue-300 hover, which is
 * wrong twice over here. On the pale card the title is blue-500 in both
 * of Gerardo's screenshots - sampled, 0,59,92 either way - so it simply
 * does not change. On the blue card blue-300 is the colour the card's
 * own gradient starts from, and the words disappeared into it.
 *
 * `:root :where(a:hover)` carries one class of specificity, so naming
 * the hover on a class of our own is what beats it.
 */
.pchs-card__link:hover,
.pchs-card__link:focus {
	color: inherit;
}

.pchs-card__link::after {
	position: absolute;
	content: "";
	inset: 0;
}

.pchs-card__link:focus-visible {
	outline: none;
}

/* The focus ring goes on the card, since the link itself is only
   as big as its text while the clickable area is the whole card. */
.pchs-card:has( .pchs-card__link:focus-visible ) {
	outline: 2px solid var(--wp--preset--color--blue-300);
	outline-offset: 2px;
}

.pchs-card__body {
	margin: 0;
	color: var(--wp--preset--color--neutral-800);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--sm); /* 14px */
	font-weight: 400;
	line-height: 21px; /* 14 x 1.5 */
}

.pchs-card__arrow {
	position: absolute;
	right: 12px;
	bottom: 12px;
	display: flex;
	width: 40px;
	height: 40px;
	align-items: center;
	justify-content: center;
	border-radius: var(--wp--custom--radius--full);
	background-color: var(--wp--preset--color--gold-400);
	color: var(--wp--preset--color--neutral-800);
	transition: background-color 0.2s ease, color 0.2s ease;
}

/*
 * The disc turns over: gold with a dark glyph becomes blue-500 with a
 * white one. Sampled from Gerardo's screenshots of the prototype, which
 * is the only place this state is drawn - the Library's card carries no
 * Hover variant.
 *
 * It used to wash out to yellow-500 and slide 2px sideways. Both were
 * invented, and the 2px broke the one rule that runs through the whole
 * design system: nothing moves.
 */
.pchs-card:hover .pchs-card__arrow {
	background-color: var(--wp--preset--color--blue-500);
	color: var(--wp--preset--color--white);
}

/* The title underlines, as a link being pointed at should. */
.pchs-card:hover .pchs-card__title {
	text-decoration: underline;
	text-underline-position: from-font;
}

@media (prefers-reduced-motion: reduce) {

	.pchs-card,
	.pchs-card__arrow {
		transition: none;
	}
}


/* ------------------------------------------------------------
   THE BLUE CARD
   Figma: Pacific College Library, "Info 3 card row-Card",
   node 6820:3081; on the page at I2843:713;6820:3158.

   The same card on a plain band instead of a blue one, so it
   takes the gradient itself and reverses its lettering out. It
   carries no photograph - nothing forbids one, the design
   simply never shows one - and its type is the larger Oswald
   title the Grants page uses.

   Written against the ROW's class because the band decides the
   card, the way the accordion's tone decides its items. A card
   never has to be told which colourway it is in.
   ------------------------------------------------------------ */

.pchs-card-row--bg-white .pchs-card {
	background-color: var(--wp--preset--color--blue-500);
	background-image: linear-gradient(
		90deg,
		var(--wp--preset--color--blue-300) 0%,
		var(--wp--preset--color--blue-500) 50%,
		var(--wp--preset--color--blue-800) 100%
	);
	color: var(--wp--preset--color--white);
}

.pchs-card-row--bg-white .pchs-card__info {
	gap: var(--wp--preset--spacing--12);
	/* Right is 12, not 24: the arrow sits in that corner and keeps its
	   own 12 from the edge. */
	padding: var(--wp--preset--spacing--24) var(--wp--preset--spacing--12) var(--wp--preset--spacing--24) var(--wp--preset--spacing--24);
}

/*
 * 28 here and 32 from 1024 up, written out because the theme's size scale
 * has no step between 24 and 48. The generated code claims 32 at every
 * width and is wrong - measured off the frame exports, "FEDERAL
 * SUPPLEMENTAL" is 265px wide at 768, which is 28px and not 32px, and at
 * 32 it would not fit that column on one line at all.
 */
.pchs-card-row--bg-white .pchs-card__title {
	color: inherit;
	font-family: var(--wp--preset--font-family--title);
	font-size: 28px;
	font-weight: 500;
	line-height: 1.16;
	letter-spacing: var(--wp--custom--tracking--normal);
	text-transform: uppercase;
}

/*
 * 16 on a phone and 20 from 768 up - the 390 frame's first body line
 * measures 245px, which is 16px and not 20px.
 *
 * The right padding is what keeps every line clear of the arrow in the
 * corner, rather than only the last one.
 */
.pchs-card-row--bg-white .pchs-card__body {
	padding-right: 40px;
	color: inherit;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--md); /* 16px */
	font-weight: 300;
	line-height: 1.36;
	letter-spacing: var(--wp--custom--tracking--tight);
}

/*
 * The disc inverts rather than going blue, which on a blue card would
 * disappear into it. Decided by Pacific College on 2026-11-01 - it is the
 * one value in this card that no frame draws, and DESIGN-QUESTIONS.md
 * asks for it.
 */
.pchs-card-row--bg-white .pchs-card:hover .pchs-card__arrow {
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--neutral-800);
}

/* The band is already pale, so the hovered card keeps its gradient and
   says so with the title alone. */
.pchs-card-row--bg-white .pchs-card:hover {
	background-color: var(--wp--preset--color--blue-500);
}


/* ------------------------------------------------------------
   768px to 1023px only
   Figma node I2001:1890;6098:4124 (card 688 x 213).

   The card lies on its side here. The photograph is a fixed
   320px wide and keeps its 3:2 shape, which is what gives the
   card its 213px height; the text sits beside it, centred
   against the picture.
   ------------------------------------------------------------ */

@media (min-width: 768px) and (max-width: 1023px) {

	.pchs-card {
		flex-direction: row;
		align-items: center;
	}

	.pchs-card__media {
		width: 320px; /* Figma: image 320 x 213 within a 688 card */
		flex-shrink: 0;
	}

	.pchs-card__info {
		/* The wide right padding is not decoration: it keeps the
		   text clear of the arrow, which sits in the bottom-right
		   corner of the card rather than below the copy. Measured
		   from the frame as 368 - 24 - 280. */
		padding: var(--wp--preset--spacing--24) var(--wp--preset--spacing--64) var(--wp--preset--spacing--24) var(--wp--preset--spacing--24);
	}

	/* The blue card has no photograph to lie beside, so it stays upright
	   here and keeps the padding it has at every other width. */
	.pchs-card-row--bg-white .pchs-card {
		flex-direction: column;
		align-items: flex-start;
	}

	.pchs-card-row--bg-white .pchs-card__info {
		padding: var(--wp--preset--spacing--24) var(--wp--preset--spacing--12) var(--wp--preset--spacing--24) var(--wp--preset--spacing--24);
	}
}


/* ------------------------------------------------------------
   1024px and up
   Figma nodes I2001:1574;6082:2020 and I2001:1732;6082:2020.

   Back to the vertical card, with a larger title.
   ------------------------------------------------------------ */

@media (min-width: 1024px) {

	.pchs-card__title {
		font-size: var(--wp--preset--font-size--lg); /* 20px */
		line-height: 24px; /* 20 x 1.2 */
	}

	.pchs-card-row--bg-white .pchs-card__title {
		font-size: 32px;
		line-height: 1.16;
	}

	/* See the note beside the gold card's colours: 16:9 here only. */
	.pchs-card-row--bg-gold .pchs-card__media {
		aspect-ratio: 16 / 9;
	}
}


/* The blue card's paragraph steps up a size earlier than its title does. */
@media (min-width: 768px) {

	.pchs-card-row--bg-white .pchs-card__body {
		font-size: var(--wp--preset--font-size--lg); /* 20px */
	}
}


/* ------------------------------------------------------------
   THE PALE CARD AND THE CREAM CARD
   Figma: PAC-Page-Designs, Holistic Nursing.
     pale  1440px I2934:27251;6082:2020, 768px
           I2934:27523;6098:4124, 390px I2936:30086;6171:3351
     gold  1440px I2934:27257;6082:2043, 768px
           I2934:27529;6098:4124, 390px I2936:30092;6171:3351

   Two more bands for the same card, written the same way as the
   blue one above: against the ROW's class, because the band
   decides the card.

   Both are the ordinary photograph-and-text card. All that
   changes is the panel it is drawn on and - on the gold band -
   which way round the disc is.
   ------------------------------------------------------------ */

/*
 * A white card on a white band would not read, so the pale band's cards
 * are gray-300. That is the same value the standard card takes when it
 * is hovered, which is why this band's card changes nothing on hover:
 * it is already there. DESIGN-QUESTIONS.md asks what it should do
 * instead; until that is answered the shrink, the disc and the
 * underline carry the state on their own, and nothing is invented.
 */
.pchs-card-row--bg-pale .pchs-card {
	background-color: var(--wp--preset--color--gray-300);
}

.pchs-card-row--bg-gold .pchs-card {
	background-color: var(--wp--preset--color--yellow-200);
}

/*
 * ON A LAPTOP the gold card's picture is 16:9, where every other card
 * crops to 3:2 at every width. These are accreditation marks on a white
 * panel rather than photographs, and the wide frame draws the panel
 * shallower - 140 by 78.75 in the generated code, 16:9 exactly.
 *
 * It is only the wide frame. The 390 export measures the panel 233 tall
 * in a 350 card, which is 3:2 and the same as every other card - checked
 * by scanning the export for where the white ends, because the two ratios
 * are 37px apart and a card is not obviously one or the other by eye.
 * That rule therefore sits in the 1024 block further down.
 */

/*
 * 20px at every width, where the standard card is 16 below 1024 and 20
 * above it. Read from all three frames rather than from one: the
 * generated code names Label/Large at 390, 768 and 1440 alike.
 */
.pchs-card-row--bg-pale .pchs-card__title,
.pchs-card-row--bg-gold .pchs-card__title {
	font-size: var(--wp--preset--font-size--lg); /* 20px */
	line-height: 24px; /* 20 x 1.2 */
}

/*
 * On the gold band the disc is blue with a white glyph AT REST - the
 * inverse of the gold disc everywhere else, because a gold disc on a
 * gold card would vanish. Pacific College confirmed that it does not
 * change on hover; the rule above it in this file happens to set the
 * same two values, so the hover is a no-op rather than an exception.
 */
.pchs-card-row--bg-gold .pchs-card__arrow {
	background-color: var(--wp--preset--color--blue-500);
	color: var(--wp--preset--color--white);
}

/*
 * The hovered panel stays cream. gray-300 is a cool grey and this card
 * is warm, so the standard hover would lay a grey-blue wash over it -
 * the same reason the gold accordion tone opts out of it. No warm
 * equivalent is written anywhere in the design system.
 */
.pchs-card-row--bg-gold .pchs-card:hover {
	background-color: var(--wp--preset--color--yellow-200);
}
