/* ============================================================
 * Campus Tables — Aceable template
 *
 * Color tokens (--ct-cta-bg, --ct-section-bg, …) are injected inline
 * from the table meta, so each table on the page can have its own palette
 * without conflicting selectors.
 * ============================================================ */

.ct-aceable {
	--ct-cta-bg:       #ff8040;
	--ct-cta-hover:    #e66a26;
	--ct-cta-text:     #ffffff;
	--ct-section-bg:   #ff8040;
	--ct-section-text: #ffffff;
	--ct-badge-bg:     #091d70;
	--ct-badge-text:   #ffffff;

	--ct-navy:    #091d70;
	--ct-text:    #1a1a1a;
	--ct-muted:   #6a727b;
	--ct-line:    #e5e7eb;
	--ct-bg:      #ffffff;
	--ct-bg-alt:  #f7f8fa;
	--ct-green:   #009e60;

	font-family: inherit;
	color: var(--ct-text);
	max-width: 100%;
}

.ct-aceable * { box-sizing: border-box; }

.ct-aceable__caption {
	font-size: 22px;
	font-weight: 700;
	color: var(--ct-navy);
	margin: 0 0 8px;
}

.ct-aceable__description {
	color: var(--ct-muted);
	margin: 0 0 24px;
}

/* ----- Plan cards row ------------------------------------- */

.ct-aceable__plans {
	display: grid;
	grid-template-columns: repeat(var(--ct-plans, 3), minmax(0, 1fr));
	gap: 22px;
	align-items: stretch;
	margin-bottom: 36px;
}

.ct-aceable__plan {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 14px;
	background: var(--ct-bg);
	border: 1px solid #eef0f4;
	border-radius: 14px;
	padding: 28px 24px 24px;
	text-align: center;
	box-shadow: 0 14px 36px -16px rgba(15, 23, 42, 0.20),
				0 2px 6px rgba(15, 23, 42, 0.04);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}
/* The CTA stretches full-width by default; layout variants below override. */
.ct-aceable__plan > .ct-aceable__cta { align-self: stretch; }

/* ----- Layout variant: "aligned" (Aceable-style, left-aligned content) -----
 *
 * Name, descriptor, savings pill, and price line align left. The price row
 * shows the strike-through old price beside the current price. The details
 * link stays center-aligned and the CTA stretches full-width with centered
 * label, matching the reference Aceable Agent design. */
.ct-aceable--layout-aligned .ct-aceable__plan { text-align: left; }
.ct-aceable--layout-aligned .ct-aceable__plan-head { align-items: flex-start; }
.ct-aceable--layout-aligned .ct-aceable__plan-name,
.ct-aceable--layout-aligned .ct-aceable__plan-desc { text-align: left; }
.ct-aceable--layout-aligned .ct-aceable__price-block {
	align-items: flex-start;
	text-align: left;
}
.ct-aceable--layout-aligned .ct-aceable__price-line {
	flex-direction: row;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
}
/* Details link stays centered, CTA stretches full-width centered. */
.ct-aceable--layout-aligned .ct-aceable__details-link { align-self: center; }
.ct-aceable--layout-aligned .ct-aceable__cta { text-align: center; }
.ct-aceable--layout-aligned .ct-aceable__guarantee { text-align: center; }

/* ----- No-CTA variant ------------------------------------
 * When the admin hides the Enrol button for a plan, the card needs to stay
 * visually balanced: push the details link to the bottom (it inherits the
 * CTA's role as the primary action), center it in both layout variants,
 * and give the guarantee line a touch more breathing room. */
.ct-aceable__plan.is-no-cta { padding-bottom: 28px; }
.ct-aceable__plan.is-no-cta .ct-aceable__details-link {
	margin-top: auto;
	align-self: center;
	font-size: 15px;
	padding: 6px 4px;
}
.ct-aceable--layout-aligned .ct-aceable__plan.is-no-cta .ct-aceable__details-link { align-self: center; }
.ct-aceable__plan.is-no-cta .ct-aceable__guarantee { margin-top: 4px; }

.ct-aceable__plan:hover {
	transform: translateY(-2px);
	box-shadow: 0 22px 50px -20px rgba(15, 23, 42, 0.28),
				0 4px 10px rgba(15, 23, 42, 0.06);
}

.ct-aceable__plan.is-featured {
	border-color: var(--ct-cta-bg);
	box-shadow: 0 22px 60px -18px rgba(15, 23, 42, 0.32),
				0 4px 10px rgba(15, 23, 42, 0.08);
	transform: translateY(-6px);
}

.ct-aceable__badge {
	position: absolute;
	top: -14px;
	background: var(--ct-badge-bg);
	color: var(--ct-badge-text);
	font-weight: 800;
	font-size: 11px;
	letter-spacing: 0.08em;
	padding: 7px 16px;
	border-radius: 999px;
	text-transform: uppercase;
	white-space: nowrap;
	border: 2px solid #fff;
	box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.18);
}
/* Centered: floats above the card horizontally centered. */
.ct-aceable--badge-centered .ct-aceable__badge {
	left: 50%;
	transform: translateX(-50%);
}
/* Left: pinned to the top-left corner of the card. */
.ct-aceable--badge-left .ct-aceable__badge {
	left: 20px;
	transform: none;
}

.ct-aceable__plan-head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}
.ct-aceable__plan-name {
	font-size: 26px;
	font-weight: 800;
	margin: 0;
	color: var(--ct-text);
	line-height: 1.1;
	text-align: center;
}
.ct-aceable__plan-desc {
	font-size: 15px;
	color: var(--ct-muted);
	margin: 0;
	line-height: 1.45;
	text-align: center;
}

.ct-aceable__price-block {
	margin-top: 8px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	text-align: center;
}

.ct-aceable__savings-pill {
	font-size: 13px;
	font-weight: 800;
	color: #d6336c;
	letter-spacing: 0.04em;
}

.ct-aceable__price-line {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}
.ct-aceable__price-old,
.ct-aceable__price-old * {
	font-size: 22px;
	font-weight: 700;
	color: #9aa1ad !important;
	text-decoration: line-through !important;
	line-height: 1;
}
.ct-aceable__price {
	font-size: 36px;
	font-weight: 800;
	line-height: 1;
	color: var(--ct-navy);
}
.ct-aceable__price .woocommerce-Price-currencySymbol { font-weight: 700; }

.ct-aceable__details-link {
	font-size: 14px;
	font-weight: 700;
	color: var(--ct-navy);
	text-decoration: underline;
	text-underline-offset: 4px;
	text-decoration-style: dotted;
	text-decoration-thickness: 1.5px;
	align-self: center;
}
.ct-aceable__details-link:hover { color: var(--ct-cta-bg); }

/* CTA — bumped specificity so aggressive theme `a` rules (Avada/Fusion, etc.)
 * can't override the user-picked colours. */
.ct-aceable a.ct-aceable__cta,
.ct-aceable a.ct-aceable__cta:link,
.ct-aceable a.ct-aceable__cta:visited {
	display: inline-block;
	background: var(--ct-cta-bg);
	color: var(--ct-cta-text) !important;
	font-weight: 800;
	font-size: 17px;
	padding: 16px 22px;
	border-radius: 999px;
	text-align: center;
	text-decoration: none !important;
	border: none;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.05s ease;
	box-shadow: 0 4px 14px -4px rgba(0,0,0,0.15);
}
.ct-aceable a.ct-aceable__cta:hover,
.ct-aceable a.ct-aceable__cta:focus,
.ct-aceable a.ct-aceable__cta:active {
	background: var(--ct-cta-hover);
	color: var(--ct-cta-text) !important;
	text-decoration: none !important;
}
.ct-aceable a.ct-aceable__cta:active { transform: translateY(1px); }

.ct-aceable__guarantee {
	font-size: 13px;
	color: var(--ct-cta-bg);
	font-weight: 600;
	margin: 0;
	text-align: center;
}

/* ----- Sticky comparison header -------------------------- */

.ct-aceable__compare {
	background: var(--ct-bg);
	border: 1px solid var(--ct-line);
	border-radius: 12px;
	/* `clip` masks rounded corners without creating a scroll context, so the
	 * sticky compare-head row works. `overflow: hidden` would break sticky
	 * inside Avada/Fusion render contexts. */
	overflow: clip;
	scroll-margin-top: 96px;
}

.ct-aceable__compare-head-wrap { position: relative; }

.ct-aceable__compare-head {
	display: grid;
	grid-template-columns: minmax(260px, 1.4fr) repeat(var(--ct-plans, 3), minmax(0, 1fr));
	background: var(--ct-bg);
	border-bottom: 1px solid var(--ct-line);
	z-index: 5;
	box-shadow: 0 2px 6px rgba(0,0,0,0.04);
	box-sizing: border-box;
}

/* JS sticky polyfill — when the user scrolls past the natural position of the
 * head row, JS applies width/left inline + adds `is-stuck`. Native
 * `position: sticky` is unreliable inside Avada/Fusion row wrappers (which use
 * overflow:hidden and transforms). */
.ct-aceable__compare-head.is-stuck {
	position: fixed !important;
	top: 0;
	z-index: 9999;
	box-shadow: 0 6px 16px -4px rgba(0,0,0,0.12);
	background: var(--ct-bg);
	border-top: 1px solid var(--ct-line);
}

/* Polyfill spacer — fills the gap when the head row goes `position: fixed`
 * so the section content below doesn't jump up. Separate class so it can't
 * be confused with the in-grid label-column placeholder (also a div, but
 * lives inside .ct-aceable__compare-head). */
.ct-aceable__sticky-spacer { display: block; }
.ct-aceable__sticky-spacer[hidden] { display: none; }
.ct-aceable__compare-head-spacer {}
.ct-aceable__compare-head-cell {
	padding: 14px 12px;
	text-align: center;
	color: var(--ct-text);
}
.ct-aceable__compare-head-cell.is-featured { color: var(--ct-cta-bg); }

/* Toggle (plan name + chevron) — the whole label is clickable to expand.
 * Selectors crank specificity + use !important to defeat theme/page-builder
 * <button> rules (Avada/Fusion drop chrome on every button by default). */
.ct-aceable button.ct-aceable__compare-head-toggle,
.ct-aceable button.ct-aceable__compare-head-toggle:hover,
.ct-aceable button.ct-aceable__compare-head-toggle:focus {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: none !important;
	box-shadow: none !important;
	padding: 4px 0 !important;
	margin: 0 !important;
	cursor: pointer;
	font: inherit !important;
	font-size: 18px !important;
	font-weight: 800 !important;
	color: inherit !important;
	line-height: 1.1 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	min-height: 0;
	width: auto;
	height: auto;
	border-radius: 0;
}
.ct-aceable__compare-head-name { color: inherit; }
.ct-aceable__compare-head-chevron {
	display: inline-flex;
	width: 16px;
	height: 16px;
	align-items: center;
	justify-content: center;
	color: inherit;
	transition: transform 0.18s ease;
}
.ct-aceable__compare-head-cell.is-open .ct-aceable__compare-head-chevron {
	transform: rotate(180deg);
}

/* Popout panel under the plan name — price, strikethrough, mini CTA. */
.ct-aceable__compare-head-popout {
	margin-top: 8px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: center;
}
/* UA's [hidden]{display:none} loses specificity to `display: flex` above,
 * so make the hidden state explicit. */
.ct-aceable__compare-head-popout[hidden] { display: none !important; }
.ct-aceable .ct-aceable__feature-details[hidden] { display: none !important; }
.ct-aceable__compare-head-prices {
	display: flex;
	gap: 8px;
	align-items: baseline;
	justify-content: center;
	flex-wrap: wrap;
}
.ct-aceable__compare-head-price-old,
.ct-aceable__compare-head-price-old * {
	color: #9aa1ad !important;
	text-decoration: line-through !important;
	font-size: 14px;
	font-weight: 600;
}
.ct-aceable__compare-head-price {
	color: var(--ct-navy);
	font-weight: 800;
	font-size: 18px;
}
/* Mini Enroll button — same pill design as the main CTA, smaller scale.
 * Same bulletproof selector chain to defeat theme link rules. */
.ct-aceable a.ct-aceable__compare-head-cta,
.ct-aceable a.ct-aceable__compare-head-cta:link,
.ct-aceable a.ct-aceable__compare-head-cta:visited {
	display: inline-block;
	padding: 9px 22px !important;
	border-radius: 999px !important;
	background: var(--ct-cta-bg) !important;
	background-color: var(--ct-cta-bg) !important;
	background-image: none !important;
	color: var(--ct-cta-text) !important;
	font-weight: 800 !important;
	font-size: 13px !important;
	line-height: 1.2 !important;
	text-decoration: none !important;
	letter-spacing: 0.02em;
	white-space: nowrap;
	border: none !important;
	box-shadow: 0 3px 10px -3px rgba(0,0,0,0.18) !important;
	transition: background 0.15s ease;
}
.ct-aceable a.ct-aceable__compare-head-cta:hover,
.ct-aceable a.ct-aceable__compare-head-cta:focus,
.ct-aceable a.ct-aceable__compare-head-cta:active {
	background: var(--ct-cta-hover) !important;
	background-color: var(--ct-cta-hover) !important;
	color: var(--ct-cta-text) !important;
	text-decoration: none !important;
}

/* ----- Feature sections ----------------------------------- */

.ct-aceable__sections { display: flex; flex-direction: column; }

.ct-aceable__section { border-top: 1px solid var(--ct-line); }
.ct-aceable__section:first-child { border-top: none; }

.ct-aceable .ct-aceable__section-head {
	background: var(--ct-section-bg);
	color: var(--ct-section-text) !important;
	padding: 12px 20px;
}
.ct-aceable .ct-aceable__section-head h3.ct-aceable__section-title,
.ct-aceable h3.ct-aceable__section-title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	color: var(--ct-section-text) !important;
}
.ct-aceable .ct-aceable__section-desc {
	margin-top: 4px;
	color: var(--ct-section-text) !important;
	font-size: 14px;
	opacity: 0.88;
}

.ct-aceable__features { display: flex; flex-direction: column; }

.ct-aceable__feature { border-top: 1px solid var(--ct-line); }
.ct-aceable__feature:first-child { border-top: none; }

.ct-aceable__feature-row {
	display: grid;
	grid-template-columns: minmax(260px, 1.4fr) repeat(var(--ct-plans, 3), minmax(0, 1fr));
	align-items: center;
	padding: 14px 20px;
}
.ct-aceable__feature:nth-child(even) { background: var(--ct-bg-alt); }

.ct-aceable__feature-label {
	font-weight: 700;
	font-size: 15px;
	padding-right: 16px;
}
.ct-aceable__feature-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: transparent;
	border: none;
	color: inherit;
	font: inherit;
	font-weight: 700;
	padding: 4px 0;
	cursor: pointer;
	text-align: left;
}
.ct-aceable__feature-toggle:hover .ct-aceable__feature-label-text { color: var(--ct-cta-bg); }
.ct-aceable__feature-toggle-chevron {
	display: inline-flex;
	width: 18px;
	height: 18px;
	align-items: center;
	justify-content: center;
	color: var(--ct-cta-bg);
	transition: transform 0.18s ease;
}
.ct-aceable__feature.is-open .ct-aceable__feature-toggle-chevron { transform: rotate(180deg); }

.ct-aceable__feature-values { display: contents; }

.ct-aceable__feature-value {
	text-align: center;
	font-size: 14px;
	padding: 0 8px;
	min-height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--ct-text);
}
.ct-aceable__feature-value.is-featured {
	background: rgba(255, 128, 64, 0.06);
	font-weight: 700;
}

.ct-aceable__feature-details {
	padding: 0 20px 16px calc(20px + 26px);
	color: var(--ct-muted);
	font-size: 14px;
	line-height: 1.55;
}

.ct-aceable__feature-mobile-label { display: none; }

/* ----- Marks (check / x) -------------------------------- */

.ct-aceable .ct-mark {
	display: inline-flex;
	width: 26px;
	height: 26px;
	align-items: center;
	justify-content: center;
}
.ct-aceable .ct-mark--check .ct-mark__icon {
	width: 26px;
	height: 26px;
	background: var(--ct-green);
	border-radius: 50%;
	position: relative;
	box-shadow: 0 2px 4px rgba(0, 158, 96, 0.25);
}
.ct-aceable .ct-mark--check .ct-mark__icon::after {
	content: "";
	position: absolute;
	left: 7px;
	top: 9px;
	width: 11px;
	height: 5px;
	border-left: 2.5px solid #fff;
	border-bottom: 2.5px solid #fff;
	transform: rotate(-45deg);
	border-bottom-left-radius: 1px;
}

/* "Not included" — same filled-circle silhouette as the check, in a muted slate
 * grey so users can still tell at a glance which features are missing. */
.ct-aceable .ct-mark--x .ct-mark__icon {
	width: 26px;
	height: 26px;
	background: #6b7280;
	border-radius: 50%;
	position: relative;
	box-shadow: 0 2px 4px rgba(107, 114, 128, 0.25);
}
.ct-aceable .ct-mark--x .ct-mark__icon::before,
.ct-aceable .ct-mark--x .ct-mark__icon::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 14px;
	height: 2.5px;
	background: #fff;
	border-radius: 2px;
	transform-origin: center;
}
.ct-aceable .ct-mark--x .ct-mark__icon::before { transform: translate(-50%, -50%) rotate(45deg); }
.ct-aceable .ct-mark--x .ct-mark__icon::after  { transform: translate(-50%, -50%) rotate(-45deg); }

.ct-aceable .ct-feature-text { color: var(--ct-text); font-weight: 600; }

/* ----- Responsive --------------------------------------- */

@media (max-width: 900px) {
	.ct-aceable__plans { grid-template-columns: 1fr 1fr; }
	.ct-aceable__plan.is-featured { transform: none; }
}

@media (max-width: 640px) {
	.ct-aceable__plans { grid-template-columns: 1fr; }

	/* Hide the sticky comparison header on mobile — features stack instead. */
	.ct-aceable__compare-head { display: none; }

	.ct-aceable__feature-row {
		grid-template-columns: 1fr;
		gap: 10px;
	}
	.ct-aceable__feature-label {
		padding-right: 0;
		border-bottom: 1px solid var(--ct-line);
		padding-bottom: 8px;
	}
	.ct-aceable__feature-values { display: grid; grid-template-columns: 1fr; gap: 8px; }
	.ct-aceable__feature-value {
		display: flex;
		justify-content: space-between;
		text-align: left;
		padding: 4px 0;
	}
	.ct-aceable__feature-mobile-label {
		display: inline-block;
		font-size: 13px;
		font-weight: 700;
		color: var(--ct-muted);
	}
	.ct-aceable__feature-details {
		padding-left: 20px;
	}
}
