/* ==========================================================================
   TGHS — Alumni & 150th Jubilee
   user.css · Tier 1 foundation (tokens + base)

   Built to the Bridge Workbench v1 output standard: plain CSS, no build step,
   no dependencies, readable by any developer who opens it.

   RE-SKIN BY CHANGING TOKEN VALUES ONLY (section 1). Never edit rule bodies to
   change colour, spacing or type — if a value can't be expressed as a token,
   that's a gap in the token set, not a licence to hardcode.

   Load order: user.css → modules.css → custom.css
   Mirror of the content-area rules lives in editor.css — keep the two in sync.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. TOKENS
   BRAND VALUES ARE PROVISIONAL — see README, "Brand values to confirm".
   They read from the school's uniform/crest palette (Auckland blue + white,
   crest gold) but have NOT been sampled from an authoritative file.
   -------------------------------------------------------------------------- */
:root {
	/* Brand ------------------------------------------------------------- */
	--cc-frame: #10294d;            /* deep uniform blue: headers, footers, frames */
	--cc-frame-hover: #0a1c37;
	--cc-on-frame: #ffffff;         /* text/icons sitting on --cc-frame */

	--cc-accent: #1c4f9c;           /* interactive blue: links, buttons */
	--cc-accent-hover: #143b76;

	--cc-accent-2: #b08d3f;         /* crest gold: rules, jubilee marks — used sparingly */
	--cc-accent-2-hover: #95762f;

	/* Ink & surfaces ---------------------------------------------------- */
	--cc-ink: #1f2937;
	--cc-ink-soft: #55606e;
	--cc-panel: #ffffff;
	--cc-panel-alt: #f4f6f9;
	--cc-rule: #dde3ea;

	/* Type --------------------------------------------------------------
	   Body type is inherited from Cassiopeia (Roboto) by design. To move the
	   site to its own family, set --cc-font-base and uncomment the body rule
	   in section 2 — one change, not a sweep through the file.             */
	--cc-font-base: inherit;
	--cc-font-heading: inherit;
	--cc-lh: 1.6;
	--cc-lh-tight: 1.2;
	--cc-measure: 68ch;

	/* Spacing scale ----------------------------------------------------- */
	--cc-space-1: 0.25rem;
	--cc-space-2: 0.5rem;
	--cc-space-3: 1rem;
	--cc-space-4: 1.5rem;
	--cc-space-5: 2.5rem;
	--cc-space-6: 4rem;

	/* Shape -------------------------------------------------------------- */
	--cc-radius: 3px;
	--cc-radius-lg: 6px;
	--cc-shadow: 0 1px 2px rgba(16, 41, 77, 0.08), 0 8px 20px rgba(16, 41, 77, 0.06);
	--cc-transition: 0.18s ease;
}


/* --------------------------------------------------------------------------
   2. BASE & TYPOGRAPHY
   -------------------------------------------------------------------------- */

/* body { font-family: var(--cc-font-base); }  <- uncomment to override Roboto */

body {
	color: var(--cc-ink);
	line-height: var(--cc-lh);
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--cc-font-heading);
	color: var(--cc-frame);
	line-height: var(--cc-lh-tight);
	text-wrap: balance;
}

h1 { font-size: clamp(1.9rem, 1.35rem + 1.7vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem); }

/* Gold hairline under section headings — the one recurring crest cue.
   Opt out on any heading with .cc-bare. */
.cc-rule-under::after,
.container-component h2:not(.cc-bare)::after {
	content: "";
	display: block;
	width: 3rem;
	margin-top: var(--cc-space-2);
	border-top: 2px solid var(--cc-accent-2);
}

p, li {
	max-width: var(--cc-measure);
}

blockquote {
	margin: var(--cc-space-4) 0;
	padding-left: var(--cc-space-4);
	border-left: 3px solid var(--cc-accent-2);
	color: var(--cc-ink-soft);
}

hr {
	border: 0;
	border-top: 1px solid var(--cc-rule);
	margin: var(--cc-space-5) 0;
	opacity: 1;
}

::selection {
	background: var(--cc-accent);
	color: #fff;
}


/* --------------------------------------------------------------------------
   3. LINKS & FOCUS
   -------------------------------------------------------------------------- */
a {
	color: var(--cc-accent);
	text-underline-offset: 0.15em;
}

a:hover,
a:focus {
	color: var(--cc-accent-hover);
}

:focus-visible {
	outline: 3px solid var(--cc-accent-2);
	outline-offset: 2px;
}


/* --------------------------------------------------------------------------
   4. BUTTONS
   a.btn-* specificity so editor-inserted links pick the styling up.
   Exposed to editors through the TinyMCE "Link Classes List" — see README.
   -------------------------------------------------------------------------- */
a.btn-cc,
a.btn-cc-outline,
a.btn-cc-onframe {
	display: inline-block;
	padding: 0.65em 1.4em;
	border: 2px solid transparent;
	border-radius: var(--cc-radius);
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color var(--cc-transition), color var(--cc-transition),
		border-color var(--cc-transition);
}

a.btn-cc {
	background: var(--cc-accent);
	border-color: var(--cc-accent);
	color: #fff;
}

a.btn-cc:hover,
a.btn-cc:focus {
	background: var(--cc-accent-hover);
	border-color: var(--cc-accent-hover);
	color: #fff;
}

a.btn-cc-outline {
	background: transparent;
	border-color: var(--cc-accent);
	color: var(--cc-accent);
}

a.btn-cc-outline:hover,
a.btn-cc-outline:focus {
	background: var(--cc-accent);
	color: #fff;
}

/* For buttons sitting on a --cc-frame panel. */
a.btn-cc-onframe {
	background: transparent;
	border-color: var(--cc-on-frame);
	color: var(--cc-on-frame);
}

a.btn-cc-onframe:hover,
a.btn-cc-onframe:focus {
	background: var(--cc-on-frame);
	color: var(--cc-frame);
}


/* --------------------------------------------------------------------------
   5. LAYOUT HELPERS
   -------------------------------------------------------------------------- */

/* Generic responsive grid. Interim: supersede with the foundation collection
   module when modules.css is emitted from the generator. */
.cc-grid {
	display: grid;
	gap: var(--cc-space-4);
	grid-template-columns: 1fr;
}

@media (min-width: 576px) {
	.cc-grid--2,
	.cc-grid--3,
	.cc-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 992px) {
	.cc-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.cc-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Text columns (prose flowing in 2/3 columns, not a card grid). */
.cc-cols {
	column-gap: var(--cc-space-5);
}

@media (min-width: 768px) {
	.cc-cols--2 { column-count: 2; }
	.cc-cols--3 { column-count: 3; }
	.cc-cols p,
	.cc-cols li { max-width: none; }
}

/* Panels & bands. */
.cc-panel {
	background: var(--cc-panel-alt);
	padding: var(--cc-space-4);
	border-radius: var(--cc-radius-lg);
}

.cc-panel--frame {
	background: var(--cc-frame);
	color: var(--cc-on-frame);
}

.cc-panel--frame :is(h1, h2, h3, h4, h5, h6) {
	color: var(--cc-on-frame);
}

.cc-panel--frame a:not([class]) {
	color: var(--cc-on-frame);
}

.cc-stack > * + * {
	margin-top: var(--cc-space-4);
}

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


/* --------------------------------------------------------------------------
   6. CARDS
   Plain content card. Media is optional.
   -------------------------------------------------------------------------- */
.cc-card {
	display: flex;
	flex-direction: column;
	background: var(--cc-panel);
	border: 1px solid var(--cc-rule);
	border-radius: var(--cc-radius-lg);
	overflow: hidden;
}

.cc-card__media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.cc-card__body {
	padding: var(--cc-space-4);
}

.cc-card__body > :first-child { margin-top: 0; }
.cc-card__body > :last-child { margin-bottom: 0; }

.cc-card__title {
	margin-bottom: var(--cc-space-2);
	font-size: 1.15rem;
}

.cc-card__meta {
	color: var(--cc-ink-soft);
	font-size: 0.9rem;
}


/* --------------------------------------------------------------------------
   7. FIGURES
   -------------------------------------------------------------------------- */
.cc-figure {
	margin: 0 0 var(--cc-space-4);
}

.cc-figure img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--cc-radius);
}

.cc-figure figcaption {
	margin-top: var(--cc-space-2);
	color: var(--cc-ink-soft);
	font-size: 0.9rem;
	line-height: 1.45;
}


/* --------------------------------------------------------------------------
   8. TABLES
   Roll lists, honours boards, reunion schedules. Wrap in .cc-table-wrap so
   wide tables scroll rather than break the layout on a phone.
   -------------------------------------------------------------------------- */
.cc-table-wrap {
	overflow-x: auto;
	margin-bottom: var(--cc-space-4);
}

table.cc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

table.cc-table caption {
	caption-side: top;
	padding-bottom: var(--cc-space-2);
	color: var(--cc-ink-soft);
	text-align: left;
}

table.cc-table th,
table.cc-table td {
	padding: var(--cc-space-2) var(--cc-space-3);
	border-bottom: 1px solid var(--cc-rule);
	text-align: left;
	vertical-align: top;
}

table.cc-table thead th {
	background: var(--cc-frame);
	color: var(--cc-on-frame);
	border-bottom: 0;
	white-space: nowrap;
}

table.cc-table tbody tr:nth-child(even) {
	background: var(--cc-panel-alt);
}


/* --------------------------------------------------------------------------
   9. CALLOUT
   -------------------------------------------------------------------------- */
.cc-callout {
	padding: var(--cc-space-4);
	border-left: 4px solid var(--cc-accent);
	background: var(--cc-panel-alt);
	border-radius: 0 var(--cc-radius) var(--cc-radius) 0;
}

.cc-callout--gold {
	border-left-color: var(--cc-accent-2);
}

.cc-callout > :first-child { margin-top: 0; }
.cc-callout > :last-child { margin-bottom: 0; }


/* --------------------------------------------------------------------------
   10. HEADER & NAVIGATION
   Proven fix: under 992px, position the whole .container-nav to the header's
   top-right rather than fighting the toggler button itself.
   -------------------------------------------------------------------------- */
.container-header {
	background: var(--cc-frame);
	color: var(--cc-on-frame);
}

.container-header a {
	color: var(--cc-on-frame);
}

.container-header .brand-logo img {
	max-height: 88px;
	width: auto;
}

.container-header .site-description {
	color: var(--cc-on-frame);
	opacity: 0.85;
}

.container-header .metismenu .mod-menu__heading,
.container-header .metismenu a {
	color: var(--cc-on-frame);
}

.container-header .metismenu > li.active > a,
.container-header .metismenu > li > a:hover {
	border-bottom: 2px solid var(--cc-accent-2);
}

@media (max-width: 991.98px) {
	.container-header {
		position: relative;
	}

	.container-header .container-nav {
		position: absolute;
		top: var(--cc-space-3);
		right: var(--cc-space-3);
		width: auto;
		margin: 0;
		padding: 0;
	}
}


/* --------------------------------------------------------------------------
   11. FOOTER
   Proven fix: Cassiopeia makes .grid-child a max-width flex child, which
   shrink-wraps the footer content. Force block so centred footers centre.
   -------------------------------------------------------------------------- */
.container-footer {
	background: var(--cc-frame);
	color: var(--cc-on-frame);
	border-top: 3px solid var(--cc-accent-2);
}

.container-footer .grid-child {
	display: block;
}

.container-footer a {
	color: var(--cc-on-frame);
}

.container-footer a:hover,
.container-footer a:focus {
	color: var(--cc-accent-2);
}

.cc-credit {
	padding-top: var(--cc-space-3);
	font-size: 0.85rem;
	opacity: 0.8;
	text-align: center;
}

/* <span class="cy"></span> is filled by user.js, so an editable footer module
   keeps a correct year without the editor stripping anything. */


/* --------------------------------------------------------------------------
   12. UTILITIES
   -------------------------------------------------------------------------- */
.cc-center { text-align: center; }
.cc-center p, .cc-center li { margin-inline: auto; }

.cc-lead {
	font-size: 1.15rem;
	color: var(--cc-ink-soft);
}

.visually-hidden:not(:focus):not(:active) {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

@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;
	}
}


/* --------------------------------------------------------------------------
   13. PRINT
   Alumni and jubilee pages get printed — programmes, rolls, orders of service.
   -------------------------------------------------------------------------- */
@media print {
	.container-header,
	.container-footer,
	.container-nav,
	.cc-noprint {
		display: none !important;
	}

	body {
		color: #000;
	}

	a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 0.8em;
		word-break: break-all;
	}
}
