/*
Theme Name:        UC San Diego Health
Description:       Simple theme for UCSD Health sites (built for the Nephrology site), following the UC San Diego Health Brand Guidelines (pulse.ucsd.edu/brand). Shares its color/typography tokens with the ucsd-tmpgfr-calculator plugin.
Author:             UCSD Health
Requires at least:  6.0
Requires PHP:       8.4
Version:            1.0.0
License:            GPL v2 or later
License URI:        https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:        ucsdh
*/

/* ==========================================================================
   Brand tokens
   Source: UC San Diego Health Brand Guidelines (pulse.ucsd.edu/brand),
   Section 5 "Brand Elements" — Color palette / Color accessibility.
   Kept in sync with calc/assets/css/tmpgfr-calculator.css — see theme/CLAUDE.md.
   ========================================================================== */

:root {
	/* Core colors */
	--ucsd-navy: #13294b; /* PMS 2767 — logo color, dominant brand color */
	--ucsd-blue: #007dba; /* PMS 7461 */
	--ucsd-green: #008e4a; /* PMS 7725 */
	--ucsd-purple: #753bbc; /* PMS 266 */

	/* Accent colors — use sparingly and don't mix more than one per text grouping */
	--ucsd-lime: #4fc400; /* PMS 376 */
	--ucsd-orange: #ff7f00; /* PMS 144 */
	--ucsd-teal: #00bb81; /* PMS 339 */
	--ucsd-amber: #ffb000; /* PMS 7549 */
	--ucsd-pink: #d3649f; /* PMS 2038 */
	--ucsd-yellow: #ffcb00; /* PMS 116 */

	/* Neutrals */
	--ucsd-black: #0e1821; /* PMS Black 6 */
	--ucsd-white: #ffffff;
	--ucsd-cool-gray-8: #8a8a8d; /* PMS Cool Gray 8 — brand-mandated body copy color */
	--ucsd-cool-gray-4: #bcbbba; /* PMS Cool Gray 4 */

	/*
	 * Semantic aliases used by templates/CSS below.
	 *
	 * --ucsdh-text deliberately uses navy, not Cool Gray 8, for primary
	 * reading content: Cool Gray 8 on white is ~3.44:1 contrast (fails
	 * WCAG AA's 4.5:1 for normal-size body text; only clears the 3:1 floor
	 * for large text/UI). This site publishes clinical instructions, so
	 * accessibility takes priority — Cool Gray 8 is still used, but only for
	 * secondary/meta text (see --ucsdh-muted), matching how the calculator
	 * plugin already uses a muted gray for its disclaimer line.
	 */
	--ucsdh-text: var(--ucsd-navy);
	--ucsdh-link: var(--ucsd-blue);
	--ucsdh-link-hover: var(--ucsd-navy);
	--ucsdh-border: var(--ucsd-cool-gray-4);
	--ucsdh-muted: var(--ucsd-cool-gray-8);
	--ucsdh-surface: var(--ucsd-white);

	--ucsdh-font: Helvetica, Arial, sans-serif; /* substitute for Neue Haas Grotesk Pro, per brand guide */
	--ucsdh-accent-font: "Playfair Display", Georgia, serif; /* accent typeface, italic, used sparingly */
	--ucsdh-container: 1100px;
}

/* ==========================================================================
   Reset / base
   ========================================================================== */

* {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--ucsdh-font);
	font-size: 1rem;
	line-height: 1.6;
	color: var(--ucsdh-text);
	background: var(--ucsdh-surface);
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--ucsdh-link);
	text-decoration: underline;
}

a:hover,
a:focus {
	color: var(--ucsdh-link-hover);
}

h1, h2, h3, h4, h5, h6 {
	color: var(--ucsd-navy);
	line-height: 1.25;
	font-weight: 700;
}

.screen-reader-text {
	position: absolute;
	left: -9999px;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.container {
	max-width: var(--ucsdh-container);
	margin: 0 auto;
	padding: 0 1.5rem;
}

/* ==========================================================================
   Header / primary nav
   ========================================================================== */

.site-header {
	background: var(--ucsd-navy);
	color: var(--ucsd-white);
	border-bottom: 4px solid var(--ucsd-yellow); /* "116 ON 2767" is a brand-approved accessible pairing */
}

.site-header .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	padding-top: 1rem;
	padding-bottom: 1rem;
	gap: 1rem;
}

.site-branding {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.custom-logo-link img {
	display: block;
	max-height: 56px;
}

.site-title {
	margin: 0;
	font-size: 1.375rem;
}

.site-title a {
	color: var(--ucsd-white);
	text-decoration: none;
}

.site-description {
	margin: 0;
	font-size: 0.9rem;
	color: var(--ucsd-cool-gray-4);
}

.menu-toggle {
	display: none;
	background: transparent;
	color: var(--ucsd-white);
	border: 1px solid var(--ucsd-white);
	border-radius: 4px;
	padding: 0.5em 0.75em;
	font-size: 1rem;
	cursor: pointer;
}

.primary-menu-container ul {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.primary-menu-container a {
	color: var(--ucsd-white);
	text-decoration: none;
	font-weight: 600;
}

.primary-menu-container a:hover,
.primary-menu-container a:focus {
	color: var(--ucsd-yellow);
}

@media (max-width: 700px) {
	.menu-toggle {
		display: inline-block;
	}

	.primary-menu-container {
		display: none;
		width: 100%;
	}

	.primary-menu-container.is-open {
		display: block;
	}

	.primary-menu-container ul {
		flex-direction: column;
		gap: 0.75rem;
		padding-bottom: 1rem;
	}
}

/* ==========================================================================
   Content
   ========================================================================== */

.site-content {
	flex: 1;
	padding: 2.5rem 0;
}

.entry-title {
	margin-top: 0;
}

h1.entry-title {
	text-align: center;
}

.entry-title a {
	color: var(--ucsd-navy);
	text-decoration: none;
}

.entry-meta {
	color: var(--ucsdh-muted);
	font-size: 0.9rem;
	margin-bottom: 1rem;
}

article {
	margin-bottom: 3rem;
	padding-bottom: 2rem;
	border-bottom: 1px solid var(--ucsdh-border);
}

article:last-child {
	border-bottom: none;
}

.entry-footer {
	margin-top: 1rem;
	font-size: 0.9rem;
	color: var(--ucsdh-muted);
}

.page-links,
.pagination {
	margin-top: 2rem;
}

/* Accent typography: Playfair Display Italic, used sparingly per brand guide Section 5 */
blockquote {
	font-family: var(--ucsdh-accent-font);
	font-style: italic;
	font-size: 1.375rem;
	color: var(--ucsd-navy);
	border-left: 4px solid var(--ucsd-yellow);
	margin: 1.5rem 0;
	padding: 0.25rem 0 0.25rem 1.5rem;
}

/* Buttons — matches calc/assets/css/tmpgfr-calculator.css */
.button,
button[type="submit"],
input[type="submit"] {
	display: inline-block;
	background: var(--ucsd-blue);
	color: var(--ucsd-white);
	border: 1px solid var(--ucsd-blue);
	border-radius: 4px;
	padding: 0.6em 1.2em;
	font-size: 1em;
	cursor: pointer;
	text-decoration: none;
}

.button:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
	background: var(--ucsd-navy);
	border-color: var(--ucsd-navy);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
	background: var(--ucsd-navy);
	color: var(--ucsd-cool-gray-4);
	margin-top: auto;
}

.site-footer .container {
	padding-top: 2rem;
	padding-bottom: 2rem;
	font-size: 0.9rem;
}

.site-footer a {
	color: var(--ucsd-white);
}

.site-footer .row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.5rem;
}

.site-footer .col-sm-8 {
	flex: 1 1 60%;
	min-width: 280px;
}

.site-footer .col-sm-4 {
	flex: 1 1 30%;
	min-width: 160px;
	text-align: right;
}

.footer-links {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

.footer-logo {
	max-width: 180px;
}

@media (max-width: 700px) {
	.site-footer .col-sm-4 {
		text-align: left;
	}
}
