/*
Theme Name: GC Debate
Theme URI: https://gcdebate.team
Description: Identity and interface layer for the Greene County High School debate team. Child theme of Twenty Twenty-Five. Carries the brand tokens, the site chrome, the light and dark appearances, and the wpForo integration so the forum reads as part of the site rather than a plugin dropped into it.
Author: Greene County HS Debate
Template: twentytwentyfive
Version: 1.2.0
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gc-debate
*/

/* ==========================================================================
   1. TOKENS

   Two layers on purpose.

   The semantic layer (--gc-bg, --gc-fg, --gc-line …) is what everything below
   is written against, and it is the only thing that changes between the light
   and dark appearances.

   The named layer (--gc-paper, --gc-ink, --gc-red-deep …) is the vocabulary the
   GC Debate Core plugin stylesheet already reads. It is mapped onto the semantic
   layer rather than restated, so the plugin's surfaces follow the appearance
   without the plugin knowing that appearances exist.

   Contrast is noted where a value is carrying text.
   ========================================================================== */

:root {
	--gc-font-display: Platypi, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
	--gc-font-body: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--gc-font-mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;

	color-scheme: light;

	/* -- semantic ------------------------------------------------------- */
	--gc-bg: #FFFFFF;
	--gc-bg-alt: #F7F5F1;          /* raised panels                        */
	--gc-bg-sunk: #F1ECE3;         /* sand band between sections           */
	--gc-fg: #121115;              /* 17.3:1 on bg                         */
	--gc-fg-muted: #55525C;        /* 7.65:1 on bg                         */
	--gc-line: #E1DBD2;            /* dividers and card edges — decorative  */
	--gc-line-strong: #C2B9AB;     /* tick marks                           */
	--gc-line-ui: #8A8377;         /* 3.75:1 — the edge of a real control  */
	--gc-band-bg: #121115;         /* hero, draw stage, stat blocks        */
	--gc-band-fg: #F6F4F1;         /* 17.3:1 on band                       */
	--gc-band-fg-muted: #B5B0BC;   /* 8.0:1 on band                        */
	--gc-band-line: #34313C;
	--gc-accent: #D2101A;          /* solid; always carries white text     */
	--gc-accent-fg: #96070F;       /* 8.9:1 on bg — link and ghost text    */
	--gc-accent-solid: #96070F;    /* chips that must hold white text      */
	--gc-kicker: #8A6414;          /* 5.37:1 on bg — kickers and indices   */
	--gc-focus: #8A6414;

	/* -- named layer, mapped -------------------------------------------- */
	--gc-ink: var(--gc-band-bg);
	--gc-ink-2: #1D1B21;
	--gc-ink-line: var(--gc-band-line);
	--gc-paper: var(--gc-bg);
	--gc-surface: var(--gc-bg-alt);
	--gc-rule: var(--gc-line);
	--gc-red: var(--gc-accent);
	--gc-red-deep: var(--gc-accent-fg);
	--gc-gold: #C9962F;
	--gc-gold-deep: #8A6414;
	--gc-text: var(--gc-fg);
	--gc-text-muted: var(--gc-fg-muted);
	--gc-text-inv: var(--gc-band-fg);
	--gc-text-muted-inv: var(--gc-band-fg-muted);

	/* -- form ------------------------------------------------------------ */
	--gc-radius: 2px;
	--gc-radius-lg: 3px;
	--gc-shadow: 0 1px 2px rgb(18 17 21 / 6%), 0 10px 30px -18px rgb(18 17 21 / 35%);

	/* -- shell ----------------------------------------------------------- */
	--gc-gutter: clamp(1.15rem, 4vw, 3rem);
	--gc-shell: 78rem;
	--gc-tick: 12px;
}

/* The dark appearance.
   Two selectors, same declarations: the device's preference when the visitor has
   not chosen, and an explicit choice whenever they have. The explicit block is
   written second so it wins the tie at equal specificity. */

/* Phones stay light unless the visitor asks for dark.
   A student reading this on a phone that flips itself dark at sunset was getting a
   page nobody could read outdoors, so the device preference is honoured only from
   tablet width up. The explicit choice below is deliberately not size-scoped —
   tapping the appearance button still works on a phone. */

@media (prefers-color-scheme: dark) and (min-width: 48rem) {
	:root:not([data-gcd-appearance="light"]) {
		color-scheme: dark;

		--gc-bg: #131218;
		--gc-bg-alt: #1B1922;
		--gc-bg-sunk: #1E1B27;
		--gc-fg: #ECE9F2;              /* 15.4:1 on bg */
		--gc-fg-muted: #A9A3B6;        /* 7.0:1 on bg  */
		--gc-line: #322E3C;
		--gc-line-strong: #4C4759;
	--gc-line-ui: #726C80;         /* 3.70:1 */
		--gc-band-bg: #2A2534;         /* raised, not deeper, so a band still reads */
		--gc-band-fg: #F4F2F8;
		--gc-band-fg-muted: #B6B0C4;
		--gc-band-line: #463F55;
		--gc-accent-fg: #FF8B90;       /* 8.1:1 on bg */
		--gc-kicker: #E0B457;          /* 10.0:1 on bg */
		--gc-focus: #E0B457;
		--gc-gold: #E0B457;
		--gc-ink-2: #2A2734;
		--gc-shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 12px 32px -18px rgb(0 0 0 / 70%);

		/* Block presets are what Twenty Twenty-Five paints body, headings and
		   links with. Redefining the variables flips them wherever they are used,
		   whatever order the stylesheets happen to load in. */
		--wp--preset--color--base: #131218;
		--wp--preset--color--contrast: #ECE9F2;
		--wp--preset--color--accent-3: #FF8B90;
		--wp--preset--color--accent-4: #A9A3B6;
		--wp--preset--color--accent-5: #1B1922;
		--wp--preset--color--line: #322E3C;
		--wp--preset--color--ink-2: #2A2734;
	}
}

:root[data-gcd-appearance="dark"] {
	color-scheme: dark;

	--gc-bg: #131218;
	--gc-bg-alt: #1B1922;
	--gc-bg-sunk: #1E1B27;
	--gc-fg: #ECE9F2;
	--gc-fg-muted: #A9A3B6;
	--gc-line: #322E3C;
	--gc-line-strong: #4C4759;
	--gc-line-ui: #726C80;         /* 3.70:1 */
	--gc-band-bg: #2A2534;
	--gc-band-fg: #F4F2F8;
	--gc-band-fg-muted: #B6B0C4;
	--gc-band-line: #463F55;
	--gc-accent-fg: #FF8B90;
	--gc-kicker: #E0B457;
	--gc-focus: #E0B457;
	--gc-gold: #E0B457;
	--gc-ink-2: #2A2734;
	--gc-shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 12px 32px -18px rgb(0 0 0 / 70%);

	--wp--preset--color--base: #131218;
	--wp--preset--color--contrast: #ECE9F2;
	--wp--preset--color--accent-3: #FF8B90;
	--wp--preset--color--accent-4: #A9A3B6;
	--wp--preset--color--accent-5: #1B1922;
	--wp--preset--color--line: #322E3C;
	--wp--preset--color--ink-2: #2A2734;
}

/* ==========================================================================
   2. BASE
   ========================================================================== */

html {
	scrollbar-gutter: stable;
	/* The header is sticky, so an anchor must not land underneath it. */
	scroll-padding-top: 9rem;
}

body {
	background-color: var(--gc-bg);
	color: var(--gc-fg);
	font-family: var(--gc-font-body);
	font-synthesis-weight: none;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.wp-block-post-title,
.wp-block-site-title {
	font-family: var(--gc-font-display);
	font-weight: 700;
	letter-spacing: -0.015em;
	line-height: 1.12;
	text-wrap: balance;
}

p, li { text-wrap: pretty; }

/* Visible focus everywhere. Gold clears 3:1 against paper and against ink, and
   against both dark grounds, so one ring works in every appearance. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--gc-focus);
	outline-offset: 2px;
	border-radius: 2px;
}

::selection { background: var(--gc-gold); color: #121115; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}

.skip-link:focus {
	background: var(--gc-band-bg);
	color: var(--gc-band-fg);
	outline: 3px solid var(--gc-focus);
	padding: 0.75rem 1rem;
	z-index: 100000;
}

/* The flow rule. A hairline with tick marks standing on it — the column
   divisions of a debater's flowsheet, used here to separate sections. */
.gcd-tickrule,
.gcdc__rule {
	height: 9px;
	border-top: 1px solid var(--gc-line);
	background-image: repeating-linear-gradient(90deg, var(--gc-line-strong) 0 1px, transparent 1px var(--gc-tick));
	background-repeat: repeat-x;
	background-size: 100% 5px;
	background-position: 0 0;
}

/* ==========================================================================
   3. SITE CHROME — header, navigation, appearance switch

   Markup comes from the GC Debate Chrome plugin. The plugin decides who sees
   which link; this file decides what it looks like.
   ========================================================================== */

header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 200;
	background: var(--gc-bg);
}

.gcdc {
	--gcdc-wordmark: clamp(8rem, 14vw, 11.5rem);
	--gcdc-pad: clamp(0.7rem, 1.5vw, 1.15rem);
	position: relative;
	background: var(--gc-bg);
}

.gcdc.is-stuck {
	--gcdc-wordmark: clamp(5.5rem, 8vw, 6.75rem);
	--gcdc-pad: 0.35rem;
}

.gcdc__bar {
	/* Raised above the scrim, and carrying its own ground so the scrim does not
	   grey out the wordmark the moment the phone menu opens. */
	position: relative;
	z-index: 4;
	background: var(--gc-bg);
	padding-block: var(--gcdc-pad);
	padding-inline: var(--gc-gutter);
	transition: padding 0.18s ease;
}

.gcdc__inner {
	display: grid;
	grid-template-areas: "brand controls";
	grid-template-columns: auto 1fr;
	align-items: center;
	gap: 1rem;
	width: 100%;
	max-width: var(--gc-shell);
	margin-inline: auto;
}

.gcdc__brand {
	grid-area: brand;
	display: block;
	line-height: 0;
	text-decoration: none;
	border-radius: 2px;
}

.gcdc__wordmark {
	width: var(--gcdc-wordmark);
	height: auto;
	transition: width 0.18s ease;
}

.gcdc__wordmark--light { display: block; }
.gcdc__wordmark--dark { display: none; }

/* Same size rule as the tokens, or a phone in OS-dark shows the light-on-dark
   wordmark against a white bar. */
@media (prefers-color-scheme: dark) and (min-width: 48rem) {
	:root:not([data-gcd-appearance="light"]) .gcdc__wordmark--light { display: none; }
	:root:not([data-gcd-appearance="light"]) .gcdc__wordmark--dark { display: block; }
}

:root[data-gcd-appearance="dark"] .gcdc__wordmark--light { display: none; }
:root[data-gcd-appearance="dark"] .gcdc__wordmark--dark { display: block; }
:root[data-gcd-appearance="light"] .gcdc__wordmark--light { display: block; }
:root[data-gcd-appearance="light"] .gcdc__wordmark--dark { display: none; }

.gcdc__controls {
	grid-area: controls;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5rem;
}

/* -- the two chrome buttons ------------------------------------------------ */

.gcdc__appearance,
.gcdc__menu {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	min-height: 44px;
	padding: 0 0.85rem;
	border: 1px solid var(--gc-line-ui);
	border-radius: 2px;
	background: transparent;
	color: var(--gc-fg);
	font-family: var(--gc-font-body);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	user-select: none;
}

.gcdc__appearance:hover,
.gcdc__menu:hover {
	border-color: var(--gc-fg);
	background: var(--gc-bg-alt);
}

.gcdc__appearance-icon { display: inline-flex; color: var(--gc-kicker); }

.gcdc__menu-bars {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	gap: 3px;
	width: 16px;
}

.gcdc__menu-bars i {
	display: block;
	height: 2px;
	background: currentColor;
	border-radius: 1px;
}

.gcdc__menu-bars i:nth-child(2) { width: 70%; }

.gcdc.is-open .gcdc__menu {
	background: var(--gc-fg);
	color: var(--gc-bg);
	border-color: var(--gc-fg);
}

/* -- navigation ------------------------------------------------------------ */

.gcdc__nav { grid-area: nav; }

.gcdc__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.gcdc__link {
	display: flex;
	align-items: center;
	min-height: 44px;
	color: var(--gc-fg);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	text-decoration: none;
}

.gcdc__link:hover { color: var(--gc-accent-fg); }

.gcdc__link.is-current { color: var(--gc-accent-fg); }

/* Phone and tablet: the list is a panel that hangs off the bar. It is display:none
   until opened, so the links are out of the tab order rather than merely invisible. */
@media (max-width: 61.999rem) {
	/* The wordmark, a labelled Menu button and the appearance control have to
	   share the width of the cheapest phone in the room. The appearance control
	   keeps its 44px target and drops to the icon; its name is still announced. */
	.gcdc { --gcdc-wordmark: clamp(6.5rem, 30vw, 9rem); }
	.gcdc.is-stuck { --gcdc-wordmark: clamp(5.5rem, 22vw, 7rem); }

	.gcdc__inner { gap: 0.5rem; }
	.gcdc__inner > * { min-width: 0; }
	.gcdc__controls { gap: 0.4rem; }

	.gcdc__appearance {
		width: 44px;
		padding: 0;
		justify-content: center;
	}

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

	.gcdc__nav {
		display: none;
		position: absolute;
		inset-inline: 0;
		top: 100%;
		z-index: 3;
		max-height: calc(100svh - 100% - var(--wp-admin--admin-bar--height, 0px));
		overflow-y: auto;
		background: var(--gc-bg);
		border-block: 1px solid var(--gc-line);
		box-shadow: var(--gc-shadow);
	}

	.gcdc.is-open .gcdc__nav { display: block; }

	.gcdc__item + .gcdc__item { border-top: 1px solid var(--gc-line); }

	.gcdc__link {
		min-height: 56px;
		padding-inline: var(--gc-gutter);
		font-size: 0.9375rem;
	}

	.gcdc__link.is-current {
		box-shadow: inset 3px 0 0 var(--gc-accent);
	}

	.gcdc__item--cta .gcdc__link {
		background: var(--gc-band-bg);
		color: var(--gc-band-fg);
	}

	.gcdc__item--cta .gcdc__link:hover { color: var(--gc-gold); }

	.gcdc__scrim {
		position: fixed;
		inset: 0;
		z-index: 1;
		background: rgb(18 17 21 / 45%);
	}

	body.gcd-menu-open { overflow: hidden; }
}

/* Laptop and up: the list is a rail across the bar, divided by hairlines the way
   a flow divides speeches. */
@media (min-width: 62rem) {
	.gcdc__inner {
		grid-template-areas: "brand nav controls";
		grid-template-columns: auto 1fr auto;
		gap: clamp(0.75rem, 2vw, 1.75rem);
	}

	.gcdc__menu { display: none; }

	.gcdc__scrim { display: none; }

	.gcdc__list {
		display: flex;
		align-items: stretch;
		justify-content: flex-end;
		flex-wrap: nowrap;
	}

	.gcdc__item + .gcdc__item {
		border-left: 1px solid var(--gc-line);
	}

	.gcdc__link {
		padding-inline: clamp(0.5rem, 1vw, 0.9rem);
		font-size: 0.75rem;
		white-space: nowrap;
	}

	.gcdc__link.is-current {
		box-shadow: inset 0 -3px 0 var(--gc-accent);
	}

	.gcdc__item--cta {
		border-left: 0 !important;
		margin-left: 0.5rem;
		display: flex;
		align-items: center;
	}

	.gcdc__item--cta .gcdc__link {
		min-height: 40px;
		border: 1px solid var(--gc-fg);
		background: var(--gc-fg);
		color: var(--gc-bg);
		box-shadow: none !important;
	}

	.gcdc__item--cta .gcdc__link:hover {
		background: var(--gc-accent);
		border-color: var(--gc-accent);
		color: #fff;
	}
}

/* Without JavaScript the button cannot open anything, so the list is simply on. */
html:not(.gcd-js) .gcdc__nav { display: block; position: static; max-height: none; box-shadow: none; }
html:not(.gcd-js) .gcdc__menu { display: none; }

/* ==========================================================================
   4. THE SHELL

   Twenty Twenty-Five hands every page a single centred text column. That is
   right for an article and wrong for a homepage, a draw stage or a schedule,
   which is why a 42rem column sitting in the middle of a 27-inch monitor reads
   as a phone site that has been stretched.

   On the pages the plugin builds, the column is released and the page is laid
   out on its own grid: bands run edge to edge, everything else sits on a
   measured shell.
   ========================================================================== */

body.gcd-app main {
	margin-block-start: 0 !important;
	padding-inline: 0 !important;
}

body.gcd-app main > .wp-block-group.alignfull,
body.gcd-app .entry-content.alignfull {
	width: auto;
	max-width: none;
	margin-inline: 0 !important;
	padding-inline: 0 !important;
	padding-block-start: 0 !important;
}

body.gcd-app .gcd {
	max-width: none !important;
	--_r: 2px;
	--_rl: 3px;
}

/* Default placement: on the shell, gutters as margin rather than padding, so a
   bordered panel's edge lands where the header's wordmark starts and not at the
   window edge. */
body.gcd-app .gcd > *,
body.gcd-app .wp-block-post-title {
	width: min(100% - var(--gc-gutter) * 2, var(--gc-shell));
	max-width: none;
	margin-inline: auto !important;
	padding-inline: 0;
}

/* Bands: edge to edge, with the words still landing on the shell. */
body.gcd-app .gcd > .gcd-hero,
body.gcd-app .gcd > .gcd-draw,
body.gcd-app .gcd > .gcd-cta {
	width: 100%;
	max-width: none;
	padding-inline: max(var(--gc-gutter), calc((100% - var(--gc-shell)) / 2));
	border-radius: 0;
}

/* -- interior page heads --------------------------------------------------- */

body.gcd-app .wp-block-post-title {
	margin-block: 0 1.25rem;
	padding-block-start: clamp(1.5rem, 4vw, 3rem);
	font-family: var(--gc-font-display);
	font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
	letter-spacing: -0.02em;
}

/* -- the rail -------------------------------------------------------------- */

/* On a wide screen a list page stops being a column in the middle of nothing:
   the title and the page it belongs to sit in a left rail, the list runs beside
   it, and neither is stretched to a width nobody can read. */
@media (min-width: 75rem) {
	body.gcd-app.gcd-rail main > .wp-block-group.alignfull {
		display: grid;
		grid-template-columns: 16rem minmax(0, 50rem) minmax(0, 1fr);
		column-gap: 4rem;
		align-items: start;
		width: 100%;
		max-width: calc(var(--gc-shell) + var(--gc-gutter) * 2);
		margin-inline: auto !important;
		padding-inline: var(--gc-gutter) !important;
	}

	body.gcd-app.gcd-rail .wp-block-post-title {
		grid-column: 1;
		width: auto;
		max-width: none;
		margin-inline: 0 !important;
		margin-block-end: 0;
		/* Sized so that "Announcements" fits the rail on one line rather than
		   breaking in the middle of the word. */
		font-size: clamp(1.6rem, 1rem + 1.1vw, 2.125rem);
		overflow-wrap: normal;
		position: sticky;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + 8rem);
	}

	body.gcd-app.gcd-rail .entry-content {
		grid-column: 2;
		padding-block-start: clamp(1.5rem, 4vw, 3rem);
	}

	body.gcd-app.gcd-rail .gcd > * {
		width: auto;
		max-width: none;
		margin-inline: 0 !important;
		padding-inline: 0;
	}
}

/* -- the tail -------------------------------------------------------------- */

/* There is no footer, by decision. Twenty Twenty-Five's closing padding is the
   last thing on every page, and 144px of empty ground below the final block
   reads as a page that failed to load rather than one that ended. */
main > .wp-block-group.alignfull {
	padding-block-end: clamp(1.5rem, 3vw, 2.5rem) !important;
}

body.gcd-app main > .wp-block-group.alignfull {
	padding-block-end: 0 !important;
}

body.gcd-app .gcd > *:last-child {
	margin-block-end: clamp(2rem, 5vw, 4rem);
}

/* A closing band is the end of the page. Nothing goes under it. */
body.gcd-app .gcd > .gcd-cta:last-child,
body.gcd-app .gcd > .gcd-draw:last-child {
	margin-block-end: 0;
}

/* ==========================================================================
   5. THE FLOW — section rules, indices, kickers
   ========================================================================== */

body.gcd-front .gcd { counter-reset: gcdflow; }

body.gcd-front .gcd > .gcd-why,
body.gcd-front .gcd > .gcd-two-col > section {
	border-top: 2px solid var(--gc-fg);
	padding-top: clamp(1.1rem, 2vw, 1.6rem);
}

body.gcd-front .gcd-h2 {
	display: flex;
	align-items: baseline;
	gap: 0.7rem;
}

body.gcd-front .gcd-h2::before {
	content: counter(gcdflow, decimal-leading-zero) / "";
	counter-increment: gcdflow;
	flex: none;
	font-family: var(--gc-font-mono);
	font-size: 0.75em;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--gc-kicker);
	transform: translateY(-0.15em);
}

/* ==========================================================================
   6. THE HERO
   ========================================================================== */

.gcd-hero {
	background: var(--gc-band-bg);
	color: var(--gc-band-fg);
	overflow: hidden;
	margin-bottom: clamp(2.25rem, 5vw, 4rem);
	padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(2.25rem, 5vw, 4rem);
	border-block: 1px solid var(--gc-band-line);
}

/* The flowsheet, drawn rather than photographed: ruled rows, and the two vertical
   columns a resolution is argued down. It fades out before it reaches the words. */
.gcd-hero::after {
	content: "";
	position: absolute;
	inset: 0 0 0 auto;
	width: min(46%, 34rem);
	background-image:
		repeating-linear-gradient(180deg, rgb(255 255 255 / 15%) 0 1px, transparent 1px 34px),
		repeating-linear-gradient(90deg, rgb(255 255 255 / 20%) 0 1px, transparent 1px 25%),
		linear-gradient(90deg, transparent calc(50% - 1px), var(--gc-accent) calc(50% - 1px) 50%, transparent 50%),
		linear-gradient(90deg, transparent calc(75% - 1px), var(--gc-gold) calc(75% - 1px) 75%, transparent 75%);
	opacity: 0.75;
	-webkit-mask-image: linear-gradient(to left, #000 42%, transparent 100%);
	mask-image: linear-gradient(to left, #000 42%, transparent 100%);
	pointer-events: none;
}

/* On a phone the words need the whole width, so the flow drops back to a hint. */
@media (max-width: 61.999rem) {
	.gcd-hero::after { width: 45%; opacity: 0.3; }
}

.gcd-hero__eyebrow {
	position: relative;
	font-family: var(--gc-font-mono);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gc-gold);
	margin: 0 0 1.4rem;
	padding-top: 0.9rem;
	border-top: 2px solid var(--gc-gold);
	display: inline-block;
}

.gcd-hero__title {
	position: relative;
	font-size: clamp(2.35rem, 1.2rem + 4.4vw, 4.75rem);
	line-height: 1.02;
	letter-spacing: -0.025em;
	max-width: 15ch;
	margin: 0 0 1.1rem;
}

.gcd-hero__lead {
	position: relative;
	max-width: 46ch;
	font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
	color: var(--gc-band-fg-muted);
	margin: 0 0 1.75rem;
}

.gcd-hero__motto {
	position: relative;
	margin: 1.75rem 0 0;
	padding-top: 1.1rem;
	border-top: 1px solid var(--gc-band-line);
	max-width: 46ch;
	font-size: 0.875rem;
	color: var(--gc-band-fg-muted);
}

@media (min-width: 62rem) {
	.gcd-hero__title { max-width: 13ch; }
}

/* ==========================================================================
   7. COMPONENTS — the plugin's surfaces, re-cut
   ========================================================================== */

.gcd-btn {
	border-radius: 2px;
	letter-spacing: 0.02em;
}

.gcd-btn--primary {
	border-bottom: 3px solid var(--gc-accent-solid);
	background: var(--gc-accent);
	color: #fff;
}

.gcd-btn--primary:hover {
	background: var(--gc-accent-solid);
	border-bottom-color: var(--gc-band-bg);
}

/* Cards stop being grey boxes and become ruled panels — hairline all round, a
   heavier rule on top, and the accent rotating so a row of three has rhythm. */
.gcd-card {
	background: var(--gc-bg);
	border: 1px solid var(--gc-line);
	border-top: 3px solid var(--gc-fg);
	border-radius: 0;
	padding: 1.35rem 1.25rem 1.4rem;
}

/* Three columns on a laptop, two on a tablet, one on a phone — decided by the
   width available rather than by a breakpoint that guesses at it. */
.gcd-why__grid { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }

.gcd-card:nth-child(3n+1) { border-top-color: var(--gc-accent); }
.gcd-card:nth-child(3n+2) { border-top-color: var(--gc-fg); }
.gcd-card:nth-child(3n+3) { border-top-color: var(--gc-kicker); }

.gcd-card h3 {
	font-size: 1.1875rem;
	margin-bottom: 0.5em;
}

.gcd-ann,
.gcd-event,
.gcd-panel,
.gcd-filterbox,
.gcd-cal,
.gcd-empty {
	border-radius: 0;
	background: var(--gc-bg);
	border-color: var(--gc-line);
}

.gcd-empty {
	background: var(--gc-bg-alt);
	border-left: 3px solid var(--gc-line-strong);
}

.gcd-ann { border-left: 3px solid var(--gc-line-strong); }
.gcd-ann--pinned { border-left-color: var(--gc-kicker); }
.gcd-ann--urgent { border-left: 3px solid var(--gc-accent); }

.gcd-cta {
	background: var(--gc-bg-sunk);
	border-top: 2px solid var(--gc-fg);
	border-radius: 0;
	padding-block: clamp(1.75rem, 4vw, 3rem);
	margin-bottom: 0;
}

.gcd-tag {
	border-radius: 1px;
	font-family: var(--gc-font-mono);
	letter-spacing: 0.06em;
}

/* Chips carry white text, so their grounds stay dark in both appearances rather
   than following the link colour, which is light on a dark page. */
.gcd-tag--competition,
.gcd-cal__ev--competition { background: var(--gc-accent-solid); border-color: var(--gc-accent-solid); color: #fff; }
.gcd-tag--pin,
.gcd-tag--deadline,
.gcd-cal__ev--deadline { background: #8A6414; border-color: #8A6414; color: #fff; }
.gcd-tag--members { background: var(--gc-band-bg); border-color: var(--gc-band-line); color: var(--gc-band-fg); }

.gcd-event__day,
.gcd-cal__n,
.gcd-stat__n,
.gcd-ann__meta time,
.gcd-libcount,
.gcd-count {
	font-variant-numeric: tabular-nums;
}

/* Anything a visitor can operate needs an edge they can see: 3:1 against the
   ground it sits on, per WCAG 2.2 non-text contrast. The hairlines used for
   dividers and card edges are deliberately lighter and are not controls. */
/* A control is only as wide as it needs to be. A full-width <select> next to a
   two-word label reads as a form that was never laid out. */
.gcd-filters select,
.gcd-toolbar select { max-width: 18rem; }

.gcd-toolbar { align-items: flex-end; }

.gcd-tabs,
.gcd-filterbox,
.gcd-btn--ghost {
	border-color: var(--gc-line-ui);
	border-radius: 0;
}

.gcd-tab.is-active { background: var(--gc-fg); color: var(--gc-bg); }
.gcd-tab { color: var(--gc-fg-muted); }
.gcd-btn--ghost { color: var(--gc-accent-fg); }
.gcd-btn--ghost:hover { background: var(--gc-bg-alt); border-color: var(--gc-accent); }

.gcd select,
.gcd input[type=text],
.gcd input[type=url],
.gcd input[type=datetime-local],
.gcd textarea {
	border-radius: 2px;
	background: var(--gc-bg);
	color: var(--gc-fg);
	border-color: var(--gc-line-ui);
}

.gcd-stat { border-radius: 0; background: var(--gc-band-bg); }
.gcd-stat__n { color: var(--gc-gold); }

/* The sign-in gate is the first thing a family sees of the members area, so it
   reads as a considered panel rather than a paragraph that ran out. */
.gcd-gate {
	max-width: 34rem;
	background: var(--gc-bg-alt);
	border: 1px solid var(--gc-line);
	border-top: 3px solid var(--gc-accent);
	padding: clamp(1.25rem, 3vw, 2rem);
}

.gcd-gate > *:last-child { margin-bottom: 0; }

/* The page title above the panel already names the area the gate is guarding,
   so the panel repeating it was the same two words twice in a row. */
.gcd-gate > .gcd-h2 { display: none; }

.gcd-disclaimer {
	background: var(--gc-bg-alt);
	border-left: 3px solid var(--gc-kicker);
	border-radius: 0;
}

.gcd-msg { border-radius: 2px; }

/* ==========================================================================
   8. THE DRAW

   The one screen that gets projected in a classroom. It is a stage, so it runs
   edge to edge and the resolution is the only thing on it.
   ========================================================================== */

.gcd-draw {
	background: var(--gc-band-bg);
	color: var(--gc-band-fg);
	border-radius: 0;
	border-bottom: 3px solid var(--gc-accent);
	padding-block: clamp(2.25rem, 6vw, 4.5rem);
	position: relative;
}

.gcd-draw__kicker {
	font-family: var(--gc-font-mono);
	font-weight: 500;
	letter-spacing: 0.16em;
	color: var(--gc-gold);
}

.gcd-draw__text {
	max-width: 26ch;
	margin-inline: auto;
	font-size: clamp(1.6rem, 1rem + 2.6vw, 3rem);
	line-height: 1.14;
}

.gcd-draw .gcd-btn--ghost {
	color: #fff;
	border-color: rgb(255 255 255 / 32%);
}

/* Recently drawn is a reading list, not a page-wide run of text. */
.gcd-history ol,
.gcd-favs ul {
	max-width: 62rem;
	color: var(--gc-fg-muted);
}

@media (min-width: 62rem) {
	.gcd-history ol,
	.gcd-favs ul {
		columns: 2;
		column-gap: 3rem;
	}
	.gcd-history li,
	.gcd-favs li {
		break-inside: avoid;
		margin-bottom: 0.6rem;
	}
}

.gcd-filtergrid { padding-bottom: 1.25rem; }

/* ==========================================================================
   9. THE FORUM

   wpForo paints its own colours from a stylesheet this theme does not own, and
   a good many of them are dark values chosen on the assumption that whatever is
   behind them is light. Under the dark appearance that is board titles in near
   black on near black.

   Chasing every one of them would mean guessing at forum screens that cannot be
   checked from here — the topic editor, a member profile, moderation. So the
   forum keeps the light appearance, and the appearance control steps out of the
   way while a student is inside it. Everywhere else the choice holds.
   ========================================================================== */

body.gcd-forum {
	color-scheme: light;

	--gc-bg: #FFFFFF;
	--gc-bg-alt: #F7F5F1;
	--gc-bg-sunk: #F1ECE3;
	--gc-fg: #121115;
	--gc-fg-muted: #55525C;
	--gc-line: #E1DBD2;
	--gc-line-strong: #C2B9AB;
	--gc-line-ui: #8A8377;
	--gc-band-bg: #121115;
	--gc-band-fg: #F6F4F1;
	--gc-band-fg-muted: #B5B0BC;
	--gc-band-line: #34313C;
	--gc-accent-fg: #96070F;
	--gc-kicker: #8A6414;
	--gc-focus: #8A6414;
	--gc-gold: #C9962F;

	--wp--preset--color--base: #FFFFFF;
	--wp--preset--color--contrast: #121115;
	--wp--preset--color--accent-3: #96070F;
	--wp--preset--color--accent-4: #55525C;
	--wp--preset--color--accent-5: #F7F5F1;

	/* The named layer is declared once on :root as var(--gc-bg), var(--gc-fg) and so
	   on, which means it RESOLVES on :root. Overriding the semantic layer here does not
	   re-resolve it, so under the dark appearance the forum was a white page with every
	   surface inside it still painted dark — board titles in near-black on near-black.
	   The named layer has to be restated, not inherited. */
	--gc-ink: #121115;
	--gc-ink-2: #1D1B21;
	--gc-ink-line: #34313C;
	--gc-paper: #FFFFFF;
	--gc-surface: #F7F5F1;
	--gc-rule: #E1DBD2;
	--gc-red: #D2101A;
	--gc-red-deep: #96070F;
	--gc-gold-deep: #8A6414;
	--gc-text: #121115;
	--gc-text-muted: #55525C;
	--gc-text-inv: #F6F4F1;
	--gc-text-muted-inv: #B5B0BC;
	--gc-shadow: 0 1px 2px rgb(18 17 21 / 6%), 0 10px 30px -18px rgb(18 17 21 / 35%);

	background-color: #FFFFFF;
	color: #121115;
}

body.gcd-forum .gcdc__appearance { display: none; }
body.gcd-forum .gcdc__wordmark--light { display: block !important; }
body.gcd-forum .gcdc__wordmark--dark { display: none !important; }

/* The forum is a destination, not a page with a lead-in. */
body.gcd-forum main { margin-block-start: 0 !important; }

body.gcd-forum .wp-block-post-title {
	max-width: none;
	margin-inline: 0 !important;
	padding-block-start: clamp(1.25rem, 3vw, 2.25rem);
}

/* The page carried two first-level headings saying the same thing: WordPress's
   page title ("Forum") and, directly under it, wpForo's own ("Greene County HS
   Debate Forum"). wpForo's is always the more specific of the two — the board
   name on a board, the topic on a topic — so it is the one that stays. The
   :has() guard means a wpForo screen that prints no title of its own keeps the
   page title rather than losing its heading altogether. */
body.gcd-forum:has(#wpforo-title) .wp-block-post-title { display: none; }

/* Twenty Twenty-Five opens every page it lays out itself with 96px of blank
   ground. On a laptop that is air; on a phone it is a third of the screen spent
   before the first word. The shell pages already zero it; the forum did not. */
body.gcd-forum main > .wp-block-group {
	padding-block-start: clamp(1rem, 4vw, 3rem) !important;
}

/* ==========================================================================
   9b. THE UTILITY PAGES

   Twenty Twenty-Five's 404 shipped with a stock photograph of a windswept tree
   and its search results printed each page's whole content, hero and all. Both
   are now plain: what went wrong, and where everything is.
   ========================================================================== */

main.gcd-404,
main.gcd-search {
	margin-block-start: 0 !important;
	width: 100%;
	max-width: calc(var(--gc-shell) + var(--gc-gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gc-gutter);
	padding-block: clamp(1.75rem, 5vw, 3.25rem) clamp(3rem, 8vw, 6rem);
}

main.gcd-404 > *,
main.gcd-search > * {
	max-width: 46rem;
	margin-inline: 0 !important;
}

.gcd-404__kicker {
	font-family: var(--gc-font-mono);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gc-kicker);
	border-top: 2px solid var(--gc-kicker);
	padding-top: 0.9rem;
	display: inline-block;
	margin-bottom: 1rem;
}

.gcd-404__title,
.gcd-search .wp-block-query-title {
	font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
	letter-spacing: -0.02em;
	margin-block: 0 0.6em;
}

.gcd-404__list {
	list-style: none;
	padding: 0;
	margin: 1.5rem 0 2rem;
	border-top: 1px solid var(--gc-line);
	max-width: 26rem;
}

.gcd-404__list li { border-bottom: 1px solid var(--gc-line); }

.gcd-404__list a {
	display: block;
	padding: 0.85rem 0;
	font-weight: 600;
	text-decoration: none;
	color: var(--gc-fg);
}

.gcd-404__list a:hover { color: var(--gc-accent-fg); text-decoration: underline; }

.gcd-search__results .wp-block-post-title {
	font-size: 1.375rem;
	margin-block: 1.25rem 0;
	padding-block-end: 0.75rem;
	border-bottom: 1px solid var(--gc-line);
}

/* Twenty Twenty-Five paints every block button with the theme's "base" colour as
   its text, and base is the page ground — which flips dark under the dark
   appearance and leaves near-black lettering on the red button. The button's
   ground is red in both appearances, so its lettering is white in both. */
.wp-element-button,
.wp-block-button__link,
.wp-block-search__button,
.wp-block-file__button {
	color: #FFFFFF !important;
}

/* WCAG 2.2 asks for a 24px target; the label around each box is already 44px
   tall, but the box itself should not be the smaller thing on the page. */
.gcd-check input { width: 24px; height: 24px; }

/* The search block is a control, so it gets the same square edge and the same
   visible border as every other control on the site. */
.wp-block-search__input {
	border: 1px solid var(--gc-line-ui) !important;
	border-radius: 2px !important;
	background: var(--gc-bg);
	color: var(--gc-fg);
	min-height: 44px;
}

.wp-block-search__button {
	border-radius: 2px !important;
	min-height: 44px;
	border-bottom: 3px solid var(--gc-accent-solid);
}

.wp-block-search__label {
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--gc-fg-muted);
}

/* ==========================================================================
   10. LEGACY — rules kept from 1.1.2 that still earn their place
   ========================================================================== */

/* The hero carries the headline. The template's page title underneath it would
   be a second <h1> saying the same thing. */
body.home .wp-block-post-title { display: none; }

.wp-block-site-title a {
	font-family: var(--gc-font-display);
	font-weight: 800;
	letter-spacing: -0.02em;
	text-decoration: none;
	color: var(--gc-fg);
}

/* ==========================================================================
   11. THE PHONE

   Twenty Twenty-Five's global padding is 4rem. On a 390px phone that is 128px
   of a 390px screen spent on empty margin, and it applied to every page the GC
   Debate shell does not lay out itself — the forum most of all, which was
   rendering its boards in a 262px column.

   The shell pages already zero this and inset their own content. Everything
   else gets the site gutter instead.
   ========================================================================== */

@media (max-width: 47.999rem) {
	:root { --gc-gutter: clamp(1rem, 4vw, 3rem); }

	/* Twenty Twenty-Five derives two things from these variables: the page padding,
	   and the negative margin .alignfull uses to break back out of it. Overriding the
	   padding on its own leaves the breakout at -4rem and hangs every full-width block
	   48px off both edges of the phone, so the variables are what change here.
	   The shell pages keep their own !important zero and inset their content themselves. */
	body.gcd-chrome {
		--wp--style--root--padding-left: var(--gc-gutter);
		--wp--style--root--padding-right: var(--gc-gutter);
	}

	/* The gate panel carries its own padding, so the shell must not inset its
	   children a second time — that was 39px of margin on a 390px screen. */
	body.gcd-app .gcd-gate > * {
		width: auto;
		margin-inline: 0 !important;
	}

	/* The panel runs edge to edge on a phone, which is right — 348px of reading
	   width beats a card with 316px in it. Its padding is set off the gutter so the
	   first letter lands under the wordmark instead of five pixels past it. */
	body.gcd-app .gcd.gcd-gate { padding-inline: calc(var(--gc-gutter) - 1px); }

	/* Cards and panels give a little back to the words inside them. */
	.gcd-card { padding-inline: 1rem; }
	.gcd-panel { padding: 1rem; }
}
