/**
 * GC Debate — front-end surfaces.
 *
 * Reads the theme's --gc-* tokens where they exist and falls back to the same values,
 * so the plugin still looks right if the theme is ever swapped. Mobile first: every
 * layout starts in one column and earns its second.
 */

.gcd {
	--_ink: var(--gc-ink, #121115);
	--_ink2: var(--gc-ink-2, #1D1B21);
	--_paper: var(--gc-paper, #FFFFFF);
	--_surface: var(--gc-surface, #F6F4F1);
	--_rule: var(--gc-rule, #E3DED7);
	--_red: var(--gc-red, #D2101A);
	--_red-deep: var(--gc-red-deep, #96070F);
	--_gold: var(--gc-gold, #C9962F);
	--_gold-deep: var(--gc-gold-deep, #8A6414);
	--_text: var(--gc-text, #121115);
	--_muted: var(--gc-text-muted, #55525C);
	--_inv: var(--gc-text-inv, #F6F4F1);
	--_muted-inv: var(--gc-text-muted-inv, #B5B0BC);
	--_display: var(--gc-font-display, "Platypi", Georgia, serif);
	--_body: var(--gc-font-body, "Manrope", system-ui, sans-serif);
	--_r: 6px;
	--_rl: 12px;

	font-family: var(--_body);
	color: var(--_text);
	line-height: 1.6;
}

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

.gcd h1, .gcd h2, .gcd h3 { font-family: var(--_display); letter-spacing: -0.015em; line-height: 1.12; text-wrap: balance; }
.gcd-h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.125rem); margin: 0 0 0.6em; }
.gcd-h3 { font-size: 1.25rem; margin: 0 0 0.6em; }
.gcd p { text-wrap: pretty; }

.gcd :where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--_gold);
	outline-offset: 2px;
	border-radius: 3px;
}

.gcd-visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------ Buttons */

.gcd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 48px;
	padding: 0 1.25rem;
	border: 2px solid transparent;
	border-radius: var(--_r);
	font-family: var(--_body);
	font-weight: 700;
	font-size: 1rem;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.gcd-btn--primary { background: var(--_red); color: #fff; }
.gcd-btn--primary:hover { background: var(--_red-deep); color: #fff; }
.gcd-btn--ghost { background: transparent; color: var(--_red-deep); border-color: var(--_rule); }
.gcd-btn--ghost:hover { background: var(--_surface); border-color: var(--_red); }
.gcd-btn--small { min-height: 40px; padding: 0 .85rem; font-size: .875rem; }
.gcd-btn--big { min-height: 60px; font-size: 1.125rem; padding: 0 2rem; }
.gcd-btn[disabled] { opacity: .45; cursor: not-allowed; }

.gcd-link { color: var(--_red-deep); font-weight: 600; text-underline-offset: .2em; }
.gcd-link:hover { color: var(--_red); }

/* --------------------------------------------------------------------- Hero */

.gcd-hero {
	background: var(--_ink);
	color: var(--_inv);
	border-radius: var(--_rl);
	padding: 2rem 1.25rem 1.75rem;
	margin: 0 0 3rem;
	position: relative;
	overflow: hidden;
}

/* Two angled bands — the two sides of a resolution meeting. No stock imagery.
   Masked so the leading edge dissolves rather than cutting across the headline,
   and dropped entirely on small screens where the words need the full width. */
.gcd-hero::after {
	content: "";
	position: absolute;
	inset: 0 0 0 auto;
	width: 30%;
	background:
		linear-gradient(115deg, transparent 42%, var(--_red) 42% 58%, transparent 58%),
		linear-gradient(115deg, transparent 62%, var(--_gold) 62% 70%, transparent 70%);
	opacity: .18;
	-webkit-mask-image: linear-gradient(to left, #000 50%, transparent 100%);
	mask-image: linear-gradient(to left, #000 50%, transparent 100%);
	pointer-events: none;
}

@media (max-width: 899px) {
	.gcd-hero::after { display: none; }
}

.gcd-hero__eyebrow {
	font-size: .75rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	font-weight: 700;
	color: var(--_gold);
	margin: 0 0 1rem;
}

.gcd-hero__title {
	font-size: clamp(1.75rem, 1.2rem + 3.2vw, 3.75rem);
	margin: 0 0 1rem;
	color: #fff;
	position: relative;
}

.gcd-hero__title span { color: var(--_gold); }

.gcd-hero__lead {
	max-width: 46ch;
	font-size: 1rem;
	color: var(--_muted-inv);
	margin: 0 0 1.75rem;
	position: relative;
}

.gcd-hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; position: relative; }
.gcd-hero__actions .gcd-btn--ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.gcd-hero__actions .gcd-btn--ghost:hover { background: rgba(255,255,255,.08); border-color: var(--_gold); color: #fff; }

.gcd-hero__motto {
	margin: 2rem 0 0;
	font-size: .875rem;
	color: var(--_muted-inv);
	position: relative;
}
.gcd-hero__motto em { color: var(--_muted-inv); opacity: .8; font-style: normal; }

/* ------------------------------------------------------------------- Layout */

.gcd-two-col { display: grid; gap: 2.5rem; margin: 0 0 3rem; }
.gcd-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.gcd-more { font-size: .9375rem; font-weight: 600; color: var(--_red-deep); }

.gcd-why { margin: 0 0 3rem; }
.gcd-why__grid { display: grid; gap: 1rem; }

.gcd-card {
	background: var(--_surface);
	border: 1px solid var(--_rule);
	border-radius: var(--_rl);
	padding: 1.25rem;
}
.gcd-card h3 { font-size: 1.125rem; margin: 0 0 .4em; }
.gcd-card p { margin: 0; font-size: .9375rem; color: var(--_muted); }

.gcd-cta {
	border-top: 3px solid var(--_red);
	background: var(--_surface);
	border-radius: 0 0 var(--_rl) var(--_rl);
	padding: 1.5rem;
	margin: 0 0 2rem;
}
.gcd-cta p { margin: 0; max-width: 60ch; }

/* -------------------------------------------------------------------- Lists */

.gcd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }

.gcd-ann {
	border: 1px solid var(--_rule);
	border-radius: var(--_rl);
	padding: 1.125rem;
	background: var(--_paper);
}
.gcd-ann--pinned { border-color: var(--_gold); }
.gcd-ann--urgent { border-left: 5px solid var(--_red); }
.gcd-ann__title { font-size: 1.1875rem; margin: .1em 0 .35em; }
.gcd-ann__body { font-size: .9375rem; color: var(--_muted); }
.gcd-ann__body p:first-child { margin-top: 0; }
.gcd-ann__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .75rem; color: var(--_muted); }
.gcd-ann__meta time { margin-left: auto; font-variant-numeric: tabular-nums; }

.gcd-tag {
	display: inline-block;
	padding: .18em .5em;
	border-radius: 999px;
	background: var(--_surface);
	border: 1px solid var(--_rule);
	font-size: .6875rem;
	font-weight: 700;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: var(--_muted);
}
.gcd-tag--urgent { background: var(--_red); border-color: var(--_red); color: #fff; }
.gcd-tag--pin { background: var(--_gold-deep); border-color: var(--_gold-deep); color: #fff; }
.gcd-tag--members { background: var(--_ink); border-color: var(--_ink); color: #fff; }
.gcd-tag--competition { background: var(--_red-deep); border-color: var(--_red-deep); color: #fff; }
.gcd-tag--deadline { background: var(--_gold-deep); border-color: var(--_gold-deep); color: #fff; }

/* ------------------------------------------------------------------- Events */

.gcd-event { display: flex; gap: 1rem; border: 1px solid var(--_rule); border-radius: var(--_rl); padding: 1rem; background: var(--_paper); }
.gcd-event.is-cancelled { opacity: .72; }
.gcd-event.is-cancelled .gcd-event__title { text-decoration: line-through; }

.gcd-event__date {
	flex: 0 0 3.5rem;
	text-align: center;
	background: var(--_ink);
	color: #fff;
	border-radius: var(--_r);
	padding: .5rem 0;
	align-self: flex-start;
}
.gcd-event__mon { display: block; font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; color: var(--_gold); font-weight: 700; }
.gcd-event__day { display: block; font-size: 1.5rem; font-weight: 800; font-family: var(--_display); line-height: 1.1; }

.gcd-event__main { min-width: 0; }
.gcd-event__title { font-size: 1.125rem; margin: .25em 0 .2em; }
.gcd-event__when { margin: 0 0 .2em; font-weight: 600; font-size: .9375rem; }
.gcd-ct { font-size: .75rem; font-weight: 700; color: var(--_muted); margin-left: .25rem; }
.gcd-event__where, .gcd-event__body { margin: 0 0 .2em; font-size: .9375rem; color: var(--_muted); }
.gcd-event__note { margin: .3em 0; font-size: .875rem; color: var(--_red-deep); font-weight: 600; }

.gcd-tzline { font-size: .875rem; color: var(--_muted); margin: 0 0 1.25rem; }

/* ------------------------------------------------------------------ Toolbar */

.gcd-toolbar { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; margin: 0 0 1rem; }
.gcd-tabs { display: inline-flex; border: 1px solid var(--_rule); border-radius: var(--_r); overflow: hidden; }
.gcd-tab { min-height: 44px; padding: 0 1.1rem; border: 0; background: transparent; font-family: var(--_body); font-weight: 700; font-size: .9375rem; cursor: pointer; color: var(--_muted); }
.gcd-tab.is-active { background: var(--_ink); color: #fff; }
.gcd-filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

.gcd select, .gcd input[type=text], .gcd input[type=url], .gcd input[type=datetime-local], .gcd textarea {
	font-family: var(--_body);
	font-size: 1rem; /* 16px stops iOS zooming on focus */
	min-height: 48px;
	padding: .5rem .7rem;
	border: 1px solid var(--_rule);
	border-radius: var(--_r);
	background: var(--_paper);
	color: var(--_text);
	width: 100%;
}
.gcd textarea { min-height: 96px; }
.gcd label { font-weight: 600; font-size: .9375rem; display: block; margin-bottom: .3rem; }
.gcd-check { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; font-size: .9375rem; margin: 0; min-height: 44px; }
.gcd-check input { width: 20px; height: 20px; }
.gcd-check-wrap { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Calendar */

.gcd-cal { border: 1px solid var(--_rule); border-radius: var(--_rl); overflow: hidden; }
.gcd-cal__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem 1rem; background: var(--_surface); border-bottom: 1px solid var(--_rule); }
.gcd-cal__title { font-family: var(--_display); font-weight: 700; font-size: 1.125rem; }
.gcd-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.gcd-cal__dow { padding: .4rem 0; text-align: center; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--_muted); border-bottom: 1px solid var(--_rule); }
.gcd-cal__cell { min-height: 78px; border-right: 1px solid var(--_rule); border-bottom: 1px solid var(--_rule); padding: .3rem; font-size: .75rem; }
.gcd-cal__cell:nth-child(7n) { border-right: 0; }
.gcd-cal__cell.is-out { background: var(--_surface); color: var(--_muted); }
.gcd-cal__cell.is-today { box-shadow: inset 0 0 0 2px var(--_gold); }
.gcd-cal__n { font-weight: 700; display: block; margin-bottom: .2rem; }
.gcd-cal__ev { display: block; background: var(--_ink); color: #fff; border-radius: 4px; padding: .12rem .3rem; margin-bottom: .15rem; font-size: .6875rem; line-height: 1.3; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcd-cal__ev--competition { background: var(--_red-deep); }
.gcd-cal__ev--deadline { background: var(--_gold-deep); }
.gcd-cal__ev.is-cancelled { text-decoration: line-through; opacity: .7; }

/* ------------------------------------------------------------------- Topics */

.gcd-draw {
	background: var(--_ink);
	color: #fff;
	border-radius: var(--_rl);
	padding: 2rem 1.25rem;
	text-align: center;
	border-bottom: 4px solid var(--_red);
}
.gcd-draw__kicker { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--_gold); margin: 0 0 1rem; }
.gcd-draw__text {
	font-family: var(--_display);
	font-size: clamp(1.35rem, 1.05rem + 1.9vw, 2.5rem);
	line-height: 1.22;
	margin: 0 auto 1rem;
	max-width: 30ch;
	color: #fff;
	border: 0;
	padding: 0;
	text-wrap: balance;
}
.gcd-draw__source { font-size: .8125rem; color: var(--_muted-inv); margin: 0 0 1.25rem; min-height: 1.2em; }
.gcd-draw__source a { color: var(--_gold); }
.gcd-draw__side { font-size: 1rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--_gold); margin: 0 0 1rem; }
.gcd-draw__actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-bottom: 1rem; }
.gcd-draw .gcd-check { color: var(--_muted-inv); }
.gcd-draw__actions .gcd-btn--ghost { color: #fff; border-color: rgba(255,255,255,.32); }
.gcd-draw__actions .gcd-btn--ghost:hover:not([disabled]) { background: rgba(255,255,255,.08); border-color: var(--_gold); }

.gcd-draw:fullscreen { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 0; padding: 4vh 6vw; }
.gcd-draw:fullscreen .gcd-draw__text { font-size: clamp(2rem, 4.5vw, 5rem); max-width: 24ch; }

.gcd-filterbox { border: 1px solid var(--_rule); border-radius: var(--_rl); margin: 1.25rem 0; background: var(--_paper); }
.gcd-filterbox > summary { padding: 1rem 1.125rem; font-weight: 700; cursor: pointer; min-height: 48px; display: flex; align-items: center; gap: .5rem; }
.gcd-filtergrid { display: grid; gap: 1rem; padding: 0 1.125rem 1.125rem; grid-template-columns: 1fr; }
.gcd-count { font-size: .8125rem; font-weight: 600; color: var(--_muted); }

.gcd-history, .gcd-favs { margin: 1.5rem 0; }
.gcd-history ol, .gcd-favs ul { padding-left: 1.2rem; font-size: .9375rem; color: var(--_muted); }
.gcd-history li, .gcd-favs li { margin-bottom: .35rem; }

.gcd-disclaimer { background: var(--_surface); border-left: 4px solid var(--_gold); border-radius: 0 var(--_r) var(--_r) 0; padding: 1rem 1.125rem; font-size: .875rem; margin: 2rem 0; }
.gcd-disclaimer p { margin: 0 0 .6em; }
.gcd-disclaimer p:last-child { margin: 0; }
.gcd-libcount { color: var(--_muted); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Dashboard */

.gcd-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin: 0 0 1.5rem; }
.gcd-stat { background: var(--_ink); color: #fff; border-radius: var(--_rl); padding: 1rem; text-align: center; }
.gcd-stat__n { display: block; font-family: var(--_display); font-size: 2rem; font-weight: 800; line-height: 1; color: var(--_gold); }
.gcd-stat__l { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--_muted-inv); margin-top: .3rem; }

.gcd-panel { border: 1px solid var(--_rule); border-radius: var(--_rl); padding: 1.25rem; margin: 0 0 1.5rem; background: var(--_paper); }
.gcd-rows { list-style: none; margin: 0; padding: 0; }
.gcd-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; padding: .85rem 0; border-bottom: 1px solid var(--_rule); }
.gcd-row:last-child { border-bottom: 0; }
.gcd-row__sub { display: block; font-size: .8125rem; color: var(--_muted); }
.gcd-row__actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.gcd-quick { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1.5rem; }

.gcd-msg { padding: .85rem 1rem; border-radius: var(--_r); font-weight: 600; margin: 0 0 1rem; }
.gcd-msg.is-ok { background: #eef7ee; border: 1px solid #bcdcbc; color: #1d4620; }
.gcd-msg.is-err { background: #fdeceb; border: 1px solid #f3bdb9; color: #7a1710; }

.gcd-note { font-size: .875rem; color: var(--_muted); }
.gcd-gate { max-width: 46ch; }

/* --------------------------------------------------------------- Empty state */

.gcd-empty {
	border: 1px dashed var(--_rule);
	border-radius: var(--_rl);
	padding: 1.5rem 1.25rem;
	background: var(--_surface);
}
.gcd-empty__headline { font-family: var(--_display); font-weight: 700; font-size: 1.0625rem; margin: 0 0 .3em; }
.gcd-empty__detail { margin: 0; font-size: .9375rem; color: var(--_muted); }

/* ------------------------------------------------------------------ Wider */

@media (min-width: 700px) {
	.gcd-hero { padding: 4rem 3rem 3rem; }
	.gcd-two-col { grid-template-columns: 1fr 1fr; gap: 3rem; }
	.gcd-why__grid { grid-template-columns: repeat(3, 1fr); }
	.gcd-filtergrid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
	.gcd-stats { grid-template-columns: repeat(4, 1fr); }
	.gcd-cal__cell { min-height: 104px; }
	.gcd-cta { padding: 2rem 2.5rem; }
}

@media (min-width: 900px) {
	/* Hold the text column clear of the bands rather than letting it run underneath. */
	.gcd-hero { padding-right: 26%; }
	.gcd-hero__title { font-size: clamp(2.2rem, 1.2rem + 2.4vw, 3.2rem); }
}

@media (prefers-reduced-motion: reduce) {
	.gcd *, .gcd *::before, .gcd *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}
