/*
 * **********************************************************************
 * Kadence Child Theme — Rules Page
 *
 * Styles for the topic-filterable, searchable rule list and the
 * single-rule detail view (/rules/{slug}/) rendered on the public
 * Rules page (slug: rules). Scoped to .mah-rules.
 *
 * @package  KadenceChild
 * @version  1.0.6
 * @updated  2026-08-25
 * **********************************************************************
 */

/* =============================================================================
   Page chrome — hide default title bar, round the boxed container
   ============================================================================= */

.mah-rules-page .entry-title,
.mah-rules-page .entry-hero-container-inner {
	display: none;
}

/* Kadence's #primary carries a fixed 80px margin-top for its title
   area regardless of whether a title renders — zero it so the hero
   sits flush under the header instead of leaving a gap of tiled
   background between the nav and the hero. */
.mah-rules-page #primary {
	margin-top: 0;
}

.mah-rules-page .content-bg {
	border-radius: var(--mah-radius-xl);
	overflow: hidden;
}

/* =============================================================================
   Hero
   ============================================================================= */

.mah-rules-hero {
	background: linear-gradient(135deg, var(--mah-green) 0%, var(--mah-green-mid) 100%);
	/* Left/right -2rem still bleeds the hero to the edges of the
	   rounded content-bg card; top is 0 (not -2rem) so the hero keeps
	   the same ~32px gap under the header as the teaching/team-building/
	   consulting pages, instead of sitting flush against it. */
	margin: 0 -2rem 24px;
	padding: 64px 24px;
	text-align: center;
}

.mah-rules-hero__inner {
	max-width: 700px;
	margin: 0 auto;
}

.mah-rules-hero__title {
	color: var(--mah-white);
	font-size: var(--mah-font-section);
	font-weight: 800;
	line-height: 1.2;
	margin: 0 0 16px;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mah-rules-hero__lead {
	color: rgba(255, 255, 255, 0.9);
	font-size: var(--mah-font-md);
	line-height: 1.7;
	margin: 0;
}

@media ( max-width: 767px ) {
	.mah-rules-hero {
		margin: -1.5rem -1.5rem 20px;
		padding: 48px 20px;
	}
}

/* =============================================================================
   Header & controls
   ============================================================================= */

.mah-rules__header {
	display: flex;
	align-items: flex-start;
	justify-content: flex-end;
	gap: var(--mah-space-5);
	margin-bottom: 24px;
}

.mah-rules__download-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--mah-space-2);
	flex-shrink: 0;
	padding: 10px 18px;
	background: var(--mah-green);
	color: var(--mah-white);
	border: none;
	border-radius: var(--mah-radius-md);
	font-size: var(--mah-font-sm2);
	font-weight: 700;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.mah-rules__download-btn:hover {
	background: var(--mah-green-mid);
}

.mah-rules__download-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.mah-rules__download-icon {
	width: 16px;
	height: 16px;
	fill: var(--mah-white);
	flex-shrink: 0;
}

@media ( max-width: 560px ) {
	.mah-rules__header {
		flex-direction: column;
	}
}

.mah-rules__controls {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 28px;
	padding-bottom: 24px;
	border-bottom: 1px solid #e0ddd6;
}

.mah-rules__search {
	width: 100%;
	max-width: 360px;
	padding: 10px 14px;
	border: 1.5px solid var(--mah-grey-300);
	border-radius: var(--mah-radius-md);
	font-size: var(--mah-font-base-sm);
	color: var(--mah-grey-900);
	background: var(--mah-white);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mah-rules__search:focus {
	outline: none;
	border-color: var(--mah-green);
	box-shadow: 0 0 0 3px rgba( 43, 127, 75, 0.12 );
}

.mah-rules__filters {
	display: flex;
	flex-wrap: wrap;
	gap: var(--mah-space-2);
}

.mah-rules__filter {
	padding: 6px 14px;
	border-radius: var(--mah-radius-pill);
	border: 1.5px solid #d8d3c8;
	background: #f8f4ee;
	color: var(--mah-green-dark);
	font-size: var(--mah-font-sm);
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.mah-rules__filter:hover {
	border-color: var(--mah-green);
}

.mah-rules__filter--active {
	background: var(--mah-green);
	border-color: var(--mah-green);
	color: var(--mah-white);
}

.mah-rules__no-results {
	color: var(--mah-grey-400);
	font-size: var(--mah-font-base-sm);
	font-style: italic;
}

/* =============================================================================
   Topic groups & entry cards
   ============================================================================= */

.mah-rules__group {
	margin-bottom: 40px;
	scroll-margin-top: 90px;
}

.mah-rules__topic-heading {
	color: var(--mah-green);
	font-size: var(--mah-font-2xl);
	font-weight: 700;
	margin: 0 0 16px;
	padding-bottom: 6px;
	border-bottom: 2px solid var(--mah-green);
}

.mah-rules__list {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 260px, 1fr ) );
	gap: 14px;
}

.mah-rules__entry {
	display: block;
	padding: 16px 18px;
	background: var(--mah-white);
	border: 1px solid #e0ddd6;
	border-radius: var(--mah-radius-md);
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.mah-rules__entry:hover {
	border-color: var(--mah-green);
	box-shadow: 0 2px 12px rgba( 43, 127, 75, 0.1 );
	transform: translateY( -1px );
}

.mah-rules__entry-title {
	color: var(--mah-green-dark);
	font-size: var(--mah-font-base);
	font-weight: 700;
	margin: 0 0 6px;
}

.mah-rules__entry-summary {
	color: var(--mah-grey-500);
	font-size: var(--mah-font-sm2);
	line-height: 1.6;
	margin: 0;
}

.mah-rules__empty {
	color: var(--mah-grey-400);
	font-size: var(--mah-font-base-sm);
	font-style: italic;
}

/* =============================================================================
   Single-rule detail view (/rules/{slug}/)
   ============================================================================= */

.mah-rules-detail__back {
	display: inline-flex;
	align-items: center;
	gap: var(--mah-space-1);
	color: var(--mah-green);
	font-size: var(--mah-font-sm2);
	font-weight: 700;
	text-decoration: none;
	margin-bottom: 24px;
}

.mah-rules-detail__back:hover {
	text-decoration: underline;
}

.mah-rules-detail__topic {
	color: var(--mah-green);
	font-size: var(--mah-font-xs);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin: 0 0 8px;
}

.mah-rules-detail__title {
	color: var(--mah-green-dark);
	font-size: var(--mah-font-5xl);
	font-weight: 800;
	margin: 0 0 12px;
}

.mah-rules-detail__summary {
	color: var(--mah-green-dark);
	font-size: var(--mah-font-lg);
	font-weight: 600;
	line-height: 1.6;
	margin: 0 0 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid #e0ddd6;
}

.mah-rules-detail__explanation p {
	color: var(--mah-grey-600);
	font-size: var(--mah-font-base);
	line-height: 1.8;
	margin: 0 0 24px;
}

.mah-rules-detail__example {
	background: #f8f4ee;
	border-left: 4px solid var(--mah-green);
	border-radius: var(--mah-radius-md);
	padding: 14px 18px;
	margin: 0 0 32px;
}

.mah-rules-detail__example-label {
	color: var(--mah-green);
	font-size: var(--mah-font-2xs);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin: 0 0 6px;
}

.mah-rules-detail__example p:last-child {
	color: var(--mah-grey-700);
	font-size: var(--mah-font-base-sm);
	line-height: 1.7;
	margin: 0;
}

.mah-rules-detail__section {
	margin-bottom: 32px;
}

.mah-rules-detail__heading {
	color: var(--mah-green);
	font-size: var(--mah-font-md2);
	font-weight: 700;
	margin: 0 0 14px;
}

.mah-rules-detail__tiles {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.mah-rules-detail__tile {
	width: 90px;
	margin: 0;
	text-align: center;
}

.mah-rules-detail__tile img {
	width: 100%;
	height: auto;
	border-radius: var(--mah-radius-md);
	border: 1px solid #e0ddd6;
	background: var(--mah-white);
	display: block;
}

.mah-rules-detail__tile figcaption {
	font-size: var(--mah-font-xs);
	color: var(--mah-grey-500);
	margin-top: 6px;
}

.mah-rules-detail__links {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: var(--mah-space-2);
}

.mah-rules-detail__links a {
	display: inline-flex;
	align-items: center;
	color: var(--mah-green-dark);
	font-weight: 600;
	text-decoration: none;
	padding: 10px 14px;
	background: #f8f4ee;
	border-radius: var(--mah-radius-md);
	transition: background 0.15s ease, color 0.15s ease;
}

.mah-rules-detail__links a:hover {
	background: var(--mah-green);
	color: var(--mah-white);
}
