/**
 * Theme Name: PCHS 2026
 * Description: Pacific College of Health and Science. Built from the Figma file PAC-Page-Designs, with each section implemented as an editable block so new pages can be assembled by swapping background, images and text.
 * Version: 0.1.0
 * Requires at least: 6.5
 * Requires PHP: 8.1
 * Text Domain: pchs2026
 */

/* ============================================================
   WHERE THE DESIGN VALUES LIVE

   Colours, font families, font sizes, spacing, shadows, corner
   radii and letter-spacing are NOT defined in this file. They
   live in theme.json, which is the single source of truth, and
   WordPress turns each one into a CSS custom property for you.

   Use them here by name:

     var(--wp--preset--color--blue-500)
     var(--wp--preset--font-size--display)
     var(--wp--preset--font-family--title)
     var(--wp--preset--spacing--64)
     var(--wp--preset--shadow--card)
     var(--wp--custom--radius--full)
     var(--wp--custom--tracking--wide)

   The reason for the indirection: WordPress serves those same
   variables to the block editor as well as to the front end, so
   a value changed in theme.json changes both. Hard-coding a hex
   or a pixel value here makes the editor disagree with the live
   page, which is exactly how the previous build went wrong.

   If you need a value that is not in theme.json, add it there
   first rather than typing the number into a stylesheet.

   Fonts are served from assets/fonts/ and declared in
   theme.json. Do not add an @import for Google Fonts: the
   editor strips it, which leaves the editor showing fallback
   fonts while the front end looks correct.
   ============================================================ */


/* ------------------------------------------------------------
   Base
   ------------------------------------------------------------ */

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	/* Font family, size, colour and line height come from
	   theme.json > styles, so they are not repeated here. */
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
}

/* Headings carry the display face and tight leading from
   theme.json. Margins are reset so each block controls its own
   spacing, which keeps a section's rhythm readable in one place
   instead of fighting inherited margins. */
h1, h2, h3, h4, h5, h6 {
	margin: 0;
	font-weight: inherit;
}

p {
	margin: 0;
}

a {
	color: inherit;
	text-decoration: none;
}


/* ------------------------------------------------------------
   Shared across sections

   A rule arrives here only once a SECOND section has needed the
   same thing. Promoting on first sighting tends to produce a
   shared rule the third section then has to fight. Layout stays
   inside each block, where a maintainer can read and change it
   in one place.
   ------------------------------------------------------------ */

/* Section padding.

   Every section so far steps through the same three values, so
   they are declared once rather than as three media queries in
   each block. They cannot live in theme.json - that format has
   no way to express a breakpoint - but the numbers are still
   its tokens, so there remains one source for the values.

   Used as:  padding: var(--pchs-section-py) var(--pchs-section-px); */
:root {
	--pchs-section-px: var(--wp--preset--spacing--20); /* 20px */
	--pchs-section-py: var(--wp--preset--spacing--40); /* 40px */
}

@media (min-width: 768px) {
	:root {
		--pchs-section-px: var(--wp--preset--spacing--40); /* 40px */
		--pchs-section-py: var(--wp--preset--spacing--64); /* 64px */
	}
}

@media (min-width: 1024px) {
	:root {
		--pchs-section-px: var(--wp--preset--spacing--64); /* 64px */
		--pchs-section-py: var(--wp--preset--spacing--80); /* 80px */
	}
}

/* The empty space beside the page on a screen wider than the cap.

   The page stops growing at 1440 and is centred, so a 1920 screen has 240px
   of room on each side. This is that number, and it is 0 at 1440 and below.

   A section's background still fills the screen - that is the whole point of
   a full-width band - so the gutter is added to the section's own padding
   rather than replacing it:

     padding: var(--pchs-section-py) calc(var(--pchs-section-px) + var(--pchs-page-gutter));

   Adding is what keeps the text in the same place relative to the page edge
   at every width. Replacing the padding instead, which is what this theme
   did until 2026-10-26, drops the 64px gutter the moment the screen passes
   1440: the text jumps 64px outwards and sits flush against the page cap
   while every other section is inset from it.

   max() rather than a media query, so there is one rule instead of one per
   section, and nothing to keep in step. The percentage is resolved where the
   variable is used, which is always a full-width section, so it measures the
   screen. */
:root {
	--pchs-page-gutter: max(0px, (100% - var(--wp--custom--breakpoint--max-page)) / 2);
}

/* Column gap of the twelve-column section grid.

   Two sections lay out on that grid so far and both step the
   same way: 40px at 768, 20px from 1024. Measured, not guessed
   - a twelve-column grid only resolves to the frames' column
   widths at those gaps.

   Only meaningful inside a grid, so blocks reference it in
   their 768-and-up rules. */
:root {
	--pchs-grid-gap: var(--wp--preset--spacing--40); /* 40px */
}

@media (min-width: 1024px) {
	:root {
		--pchs-grid-gap: var(--wp--preset--spacing--20); /* 20px */
	}
}

/* A button.

   Blue by default; add pchs-button--red for the red one. The
   designs use red on the banner and blue on a light background,
   and nothing suggests the shape differs - only the fill.

   NOTE: the hover colours below are chosen, not taken from the
   designs. The Figma file carries prototype interactions that
   have not been read yet, so these should be checked against
   them before launch. */
.pchs-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--wp--preset--spacing--16) var(--wp--preset--spacing--20);
	border-radius: var(--wp--custom--radius--full);
	background-color: var(--wp--preset--color--blue-500);
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--navigation);
	font-size: var(--wp--preset--font-size--sm); /* 14px */
	font-weight: 700;
	line-height: 1;
	letter-spacing: var(--wp--custom--tracking--wide); /* 0.08em */
	text-transform: uppercase;
	white-space: nowrap;
	transition: background-color 0.2s ease;
}

/*
 * WHERE EVERY HOVER STATE BELOW COMES FROM
 *
 * The design system draws them. Pacific College Library, page "Elements",
 * frame 6029:309 "Button", which carries a Static and a Hover-Focus-Active
 * variant of every size, type and colour. Do not invent one.
 *
 * Two rules run through the whole set, and knowing them makes the individual
 * values obvious:
 *   - a SOLID button darkens: blue-500 to blue-300, red-500 to red-900,
 *     white to gray-900, gold-400 to gold-500;
 *   - an OUTLINE button fills with the colour of its own ring and inverts
 *     its lettering.
 *
 * Nothing moves. No transform, no change of shadow, no scale. Three of the
 * variants here did one of those until 2026-10-31, all of them invented.
 */
.pchs-button:hover,
.pchs-button:focus-visible {
	background-color: var(--wp--preset--color--blue-300);
}

/* A shorter label for phones.
 *
 * Some buttons carry wording too long for a narrow column, and
 * the designs shorten it rather than let it wrap. Both labels
 * are in the markup and one is switched off per breakpoint.
 *
 * display:none, not a visually-hidden class: it takes the
 * hidden label out of the accessibility tree as well as out of
 * sight, so a screen reader announces exactly the one label a
 * sighted visitor sees, rather than both.
 *
 * These rules only ever apply when a block emits both spans,
 * which it does only when a short label has been written. A
 * button with one label is plain text and untouched by them. */
.pchs-button__label--compact {
	display: none;
}

@media (max-width: 767px) {

	.pchs-button__label--full {
		display: none;
	}

	.pchs-button__label--compact {
		display: inline;
	}
}

.pchs-button--red {
	background-color: var(--wp--preset--color--red-500);
}

/* Red darkens to red-900. It used to turn blue, which was invented rather
   than read: Figma node 6029:308 is explicit. See the note above .pchs-button
   about where these states come from. */
.pchs-button--red:hover,
.pchs-button--red:focus-visible {
	background-color: var(--wp--preset--color--red-900);
}

/* The button inverted, for a dark panel: white with blue lettering.
   Figma 2001:1706, the first panel of the Info boxes band.

   Kept here with the other variants rather than in the block that first
   needed it. The usual rule is to wait for a second section before sharing a
   rule, but that is about layout, which a later section can contradict; a
   button variant is part of a component that is already shared, and splitting
   the variants across files means a maintainer looking at .pchs-button cannot
   see what buttons the theme has. */
.pchs-button--light {
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--blue-500);
}

/* White darkens to gray-900, not gray-500. Figma node 6033:453. */
.pchs-button--light:hover,
.pchs-button--light:focus-visible {
	background-color: var(--wp--preset--color--gray-900);
}

/* The outlined button: nothing but a rule around the lettering, for use on a
   dark background beside a solid one.
   Figma I2001:1727;6040:1817, the Apply Now button on the sticky bar.

   The rule is an inset shadow rather than a border, because a border is a
   pixel of height on each side and the frames do not have it - Figma draws a
   stroke on a shape without making it taller. The button has to stay exactly
   as tall as the solid one standing next to it. */
.pchs-button--outline {
	box-shadow: inset 0 0 0 1px currentColor;
	background-color: transparent;
	color: var(--wp--preset--color--white);
}

.pchs-button--outline:hover,
.pchs-button--outline:focus-visible {
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--blue-500);
}

/* The same idea on a light background: a blue rule, blue lettering.
   Figma node 6029:301, the Apply Now button in the header.

   Its own variant rather than a colour swap on the one above, because the
   rule and the lettering are different blues - the ring is blue-300 and the
   words are blue-500 - so currentColor cannot draw both. */
.pchs-button--outline-blue {
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--blue-300);
	background-color: transparent;
	color: var(--wp--preset--color--blue-500);
}

/* Fills with the colour of its own ring - blue-300, not blue-500 - and the
   lettering goes white. Figma node 6029:302. */
.pchs-button--outline-blue:hover,
.pchs-button--outline-blue:focus-visible {
	background-color: var(--wp--preset--color--blue-300);
	color: var(--wp--preset--color--white);
}

/* The smaller button: 12px lettering with 12px of padding above and below,
   which comes out 36px tall against the standard 46.
   Figma node 6029:303 in the header, and the phone layout of the sticky bar.

   Promoted here on its second use, per the note at the top of this section. */
.pchs-button--small {
	padding: var(--wp--preset--spacing--12) var(--wp--preset--spacing--20); /* 12/20 */
	font-size: var(--wp--preset--font-size--xs); /* 12px */
}

/* The small label above a section heading: Roboto, heavy, wide
   tracking, upper case. Colour is left to the block, because
   the label sits on a dark background in some sections and a
   light one in others. */
.pchs-eyebrow {
	margin: 0;
	font-family: var(--wp--preset--font-family--navigation);
	font-size: var(--wp--preset--font-size--sm); /* 14px */
	font-weight: 700;
	line-height: 1;
	letter-spacing: var(--wp--custom--tracking--wide); /* 0.08em */
	text-transform: uppercase;
}

/* A section heading, set in the display face at its light
   weight; an editor marks any words with the Emphasis button to
   switch them to the heavier one. Colour is the block's to
   decide, for the same reason as the eyebrow.

   Line heights are whole pixels rather than the ratio of 1.16
   that Figma reports, because Figma lays text out on whole
   pixels and the leftover fraction would leave every section
   slightly taller than its frame. */
.pchs-heading-2 {
	margin: 0;
	font-family: var(--wp--preset--font-family--title);
	font-size: 32px;   /* Figma 2001:2049, title box 74px over two lines */
	font-weight: 300;
	line-height: 37px; /* 32 x 1.16 */
	letter-spacing: var(--wp--custom--tracking--label); /* 0.02em */
	text-transform: uppercase;
}

.pchs-heading-2 .pchs-em {
	font-weight: 600;
}

/* The paragraph under a section heading. Two sections use it
   with identical values, including the colour - unlike the
   heading and eyebrow, which change colour with their
   background. */
.pchs-section-intro {
	margin: 0;
	color: var(--wp--preset--color--blue-800);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--md); /* 16px */
	font-weight: 400;
	line-height: 24px; /* 16 x 1.5 */
	/*
	 * -0.02em, and worth a note because two of the BS in Nursing frames
	 * read as though it were 0: the overview band's copy measures 800
	 * pixels of ink where Work Sans sets those words in 799 at normal
	 * tracking and 767 at this. Setting this to normal moves Financial
	 * Aid instead - its small banner wraps a line longer at 768 and the
	 * band grows 30 - so the two designs disagree and this stays as the
	 * three pages built before BS in Nursing measured it. The sections
	 * that need the other value set it themselves.
	 */
	letter-spacing: var(--wp--custom--tracking--tight);
}

@media (min-width: 768px) {
	.pchs-section-intro {
		font-size: var(--wp--preset--font-size--lg); /* 20px */
		line-height: 30px; /* 20 x 1.5 */
	}
}

/* A row of social media links.
   Figma I2001:1706;6092:453 - icons 44px, 20px apart, at every width.

   The markup is built by pchs2026_social_icons() in functions.php, which is
   also where the list of networks lives. It is shared from the outset rather
   than left in the block that first needed it, because the footer will want
   the same row; a block supplies the web addresses and nothing else.

   The icon files in images/social/ are black, which is how the designs draw
   them. pchs-social--light turns them white for a dark background - inverting
   rather than shipping a second set of files, because black and white are
   exact opposites and nothing else in the image can be spoiled by it.

   The row never wraps. Five icons come to 300px, which is wider than the
   column they sit in between 1024 and 1199, and Figma draws them running on
   into the padding rather than folding onto a second line. Letting them wrap
   instead made the panel 64px taller than its frame. */
.pchs-social {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: var(--wp--preset--spacing--20); /* 20px */
	margin: 0;
	padding: 0;
	list-style: none;
}

.pchs-social__item {
	/* A flex item is allowed to shrink by default, which would squash the
	   icons rather than let the row run past its column. */
	flex: 0 0 auto;
}

.pchs-social__icon {
	width: 44px;
	height: 44px;
	/* NOTE: chosen, not taken from the designs - see the note on button
	   hover colours above. */
	transition: opacity 0.2s ease;
}

.pchs-social__link:hover .pchs-social__icon,
.pchs-social__link:focus-visible .pchs-social__icon {
	opacity: 0.7;
}

.pchs-social--light .pchs-social__icon {
	filter: invert(1);
}

/* The "opens elsewhere" mark.
   Figma node 3133:15058, "icon-utility", 16.4 square: two overlapping
   rounded rectangles, stroked at 2.

   Kept here rather than in the block that first needed it because it is a
   site-wide convention rather than one section's decoration - the Steps
   cards are only where the designs happen to show it first. To mark the
   outbound links inside anything, put .pchs-external-links on the container.

   It is a mask rather than an image, so the mark takes its link's own colour
   and follows it on hover without a second file.

   WHAT IT CANNOT KNOW: CSS can only see the address, so a link written as a
   full https:// address to a page on this site is marked too. Write internal
   links as paths - which is what the editor's link picker gives you - and
   this stays right. If that ever stops being reliable, the honest fix is to
   mark them in PHP, where the site's own host is known. */
:root {
	--pchs-icon-external: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16.4 16.4' fill='none'%3E%3Cpath d='M5 11.4H3C1.89543 11.4 1 10.5046 1 9.4V3C1 1.89543 1.89543 1 3 1H9.4C10.5046 1 11.4 1.89543 11.4 3V5' stroke='%23000' stroke-width='2'/%3E%3Crect x='5' y='5' width='10.4' height='10.4' rx='2' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E");
}

.pchs-external-links a[href^="http"]::after {
	display: inline-block;
	content: "";
	width: 0.875em;
	height: 0.875em;
	margin-left: 0.25em;
	/* Shifted against the text rather than the line box, so adding the mark
	   cannot make a line taller than the words in it. */
	vertical-align: -0.1em;
	background-color: currentColor;
	-webkit-mask: var(--pchs-icon-external) no-repeat center / contain;
	mask: var(--pchs-icon-external) no-repeat center / contain;
}

@media (min-width: 768px) {
	.pchs-heading-2 {
		font-size: 40px;   /* Figma 2001:1890, title box 46px on one line */
		line-height: 46px; /* 40 x 1.16 */
	}
}

@media (min-width: 1024px) {
	.pchs-heading-2 {
		font-size: var(--wp--preset--font-size--xxl); /* 48px */
		line-height: 56px; /* 48 x 1.16, matching the measured title box at 1440 */
	}
}

/* A registered-trademark mark, as the designs set it: smaller than the words
   around it and on the same baseline. Figma draws the one after NCLEX-RN at
   10.32px inside 16px copy - node I2329:13676;6605:1590 - which is 0.645em.

   It barely shows in body copy. In a heading it shows plainly: at 40px a
   full-size mark is 15 pixels wider than the design's, and every word after
   it on the line is pushed along by that much.

   NOT <sup>. A superscript raises the glyph, which makes the line box taller
   and pushes every line below it down three or four pixels; the mark is
   already drawn raised in the font, so there is nothing to lift. */
.pchs-mark {
	font-size: 0.645em;
	/*
	 * ZERO, not inherit. An inline box takes the line's leading and shares
	 * it above and below its own, smaller, content - so a 20.6px mark on a
	 * 37px line hangs about five pixels below the line it sits on and the
	 * line box grows to hold it. That made the NCLEX heading 79 tall
	 * against its frame's 74. With no box of its own there is nothing to
	 * grow around, and the glyph still paints where its baseline puts it.
	 */
	line-height: 0;
	vertical-align: baseline;
}

/* A step down from the section heading - Figma's Heading/H3. Same face, same
   case, same tracking; 32 until a laptop and 40 from there, where H2 goes to
   48. Used where a section's heading sits beside a picture rather than over
   the whole band. Figma 2368:2413 at 1440 and 3153:10913 at 390. */
.pchs-heading-3 {
	margin: 0;
	font-family: var(--wp--preset--font-family--title);
	font-size: 32px;
	font-weight: 300;
	line-height: 37px; /* 32 x 1.16 */
	letter-spacing: var(--wp--custom--tracking--label); /* 0.02em */
	text-transform: uppercase;
}

.pchs-heading-3 .pchs-em {
	font-weight: 600;
}

@media (min-width: 1024px) {
	.pchs-heading-3 {
		font-size: 40px;
		line-height: 46px; /* 40 x 1.16 */
	}
}


/* ------------------------------------------------------------
   Page width

   Header, content and footer stop growing at 1440px. Section
   backgrounds - colours and photographs - run the full width of
   the viewport past that point, so the cap is applied to an
   inner wrapper rather than to the section itself.
   ------------------------------------------------------------ */

.pchs-wrap {
	width: 100%;
	max-width: var(--wp--custom--breakpoint--max-page); /* 1440px */
	margin-inline: auto;
}


/* ------------------------------------------------------------
   Accessibility
   ------------------------------------------------------------ */

/* Visible only to screen readers, until focused. Used for the
   skip link in header.php. */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	z-index: 100000;
	top: var(--wp--preset--spacing--8);
	left: var(--wp--preset--spacing--8);
	width: auto;
	height: auto;
	margin: 0;
	padding: var(--wp--preset--spacing--12) var(--wp--preset--spacing--20);
	clip-path: none;
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--blue-500);
	font-family: var(--wp--preset--font-family--navigation);
	font-size: var(--wp--preset--font-size--sm);
}

/* Following a link to a section of the same page glides rather
   than jumps - which is what the jump links bar is for, and what
   its Figma annotation asks for ("tapping on the link will
   autoscroll users to the section"). On the document rather than
   in that block, because an ordinary in-page link should behave
   the same way. The reduced-motion rule below turns it off. */
html {
	scroll-behavior: smooth;
}

/* Honour a visitor's request for reduced motion. The designs
   include hover transitions; this turns them off rather than
   removing them from the CSS. */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
