/*
 * **********************************************************************
 * Blog Page — "The Mahjongg Gallery Speaks" (page ID 29)
 *
 * Loaded only on is_page(29) via functions.php.
 *
 * @package  KadenceChild
 * @version  0.3.6
 * @updated  2026-07-28
 * **********************************************************************
 */

/* =============================================================================
   Watermark background
   ============================================================================= */

/* ::before on the body creates a fixed full-viewport layer behind all content.
   contain keeps the entire image visible on every device without cropping.
   opacity: 0.07 keeps it very faint so it never competes with the text. */
.page-id-29::before {
	content: '';
	position: fixed;
	inset: 0;
	background-image: url('https://mahjartspace.com/wp-content/uploads/2026/06/blog.png');
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
	opacity: 0.20;
	z-index: -1;
	pointer-events: none;
}

/* =============================================================================
   Blog wrapper
   ============================================================================= */

.mah-blog {
	width: 100%;
}

/* =============================================================================
   Intro hero
   ============================================================================= */

/* ── Shell ──────────────────────────────────────────────────────────────────── */

.mah-blog__intro {
	padding: 80px 24px;
	text-align: center;
}

.mah-blog__intro-inner {
	max-width: 680px;
	margin: 0 auto;
}

/* ── Eyebrow ────────────────────────────────────────────────────────────────── */

.mah-blog__eyebrow {
	display: block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: rgba( 43, 127, 75, 0.65 );
	margin-bottom: 1.1rem;
}

/* ── Page title ─────────────────────────────────────────────────────────────── */

.mah-blog__title {
	font-size: clamp( 2rem, 5vw, 3.25rem );
	font-style: italic;
	font-weight: 700;
	color: #2b7f4b;
	line-height: 1.1;
	margin: 0 0 0.4rem;
	letter-spacing: -0.01em;
}

/* ── Decorative rule ────────────────────────────────────────────────────────── */

.mah-blog__rule {
	width: 3.5rem;
	height: 3px;
	background: rgba( 43, 127, 75, 0.35 );
	border-radius: 2px;
	margin: 0 auto 1.6rem;
}

/* ── Lead copy ──────────────────────────────────────────────────────────────── */

.mah-blog__lead {
	font-size: 1.08rem;
	line-height: 1.75;
	color: rgba( 0, 0, 0, 0.72 );
	margin: 0 0 0.85rem;
}

.mah-blog__sublead {
	font-size: 0.95rem;
	line-height: 1.7;
	color: rgba( 0, 0, 0, 0.50 );
	margin: 0;
}

/* =============================================================================
   Posts content area
   ============================================================================= */

.mah-blog__content {
	max-width: 1120px;
	margin: 0 auto;
	padding: 56px 24px 88px;
}

/* =============================================================================
   Post card grid
   ============================================================================= */

/* ── Grid ───────────────────────────────────────────────────────────────────── */

.mah-blog__grid {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 1.75rem;
}

@media ( max-width: 900px ) {
	.mah-blog__grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}

@media ( max-width: 580px ) {
	.mah-blog__grid {
		grid-template-columns: 1fr;
	}
}

/* ── Card shell ─────────────────────────────────────────────────────────────── */

.mah-blog__grid .mah-blog__card,
.mah-blog__card {
	background: #ffffff !important;
	border-radius: 10px;
	box-shadow: 0 2px 20px rgba( 0, 0, 0, 0.07 );
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.22s ease, transform 0.22s ease;
}

.mah-blog__card:hover {
	box-shadow: 0 10px 36px rgba( 43, 127, 75, 0.18 );
	transform: translateY( -4px );
}

/* ── Thumbnail ──────────────────────────────────────────────────────────────── */

.mah-blog__thumb-link {
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: #e8f4ec;
}

.mah-blog__thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.38s ease;
}

.mah-blog__card:hover .mah-blog__thumb {
	transform: scale( 1.05 );
}

/* ── Card body ──────────────────────────────────────────────────────────────── */

.mah-blog__card-body {
	padding: 1.4rem 1.5rem 1.5rem;
	display: flex;
	flex-direction: column;
	flex: 1;
}

/* ── Meta (date · category) ─────────────────────────────────────────────────── */

.mah-blog__meta {
	font-size: 0.73rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #2b7f4b;
	margin-bottom: 0.55rem;
}

/* ── Card title ─────────────────────────────────────────────────────────────── */

.mah-blog__card-title {
	font-size: 1.1rem;
	line-height: 1.35;
	margin: 0 0 0.8rem;
}

.mah-blog__card-title a {
	color: #1a1a1a;
	text-decoration: none;
	transition: color 0.18s ease;
}

.mah-blog__card-title a:hover {
	color: #2b7f4b;
}

/* ── Excerpt ────────────────────────────────────────────────────────────────── */

.mah-blog__excerpt {
	font-size: 0.93rem;
	line-height: 1.7;
	color: #555;
	flex: 1;
	margin-bottom: 1.2rem;
}

.mah-blog__excerpt p:last-child {
	margin-bottom: 0;
}

/* ── Read more ──────────────────────────────────────────────────────────────── */

.mah-blog__read-more {
	display: inline-flex;
	align-items: center;
	font-size: 0.85rem;
	font-weight: 700;
	color: #2b7f4b;
	text-decoration: none;
	letter-spacing: 0.03em;
	align-self: flex-start;
	border-bottom: 1.5px solid transparent;
	padding-bottom: 1px;
	transition: color 0.18s ease, border-color 0.18s ease;
}

.mah-blog__read-more:hover {
	color: #1f5e37;
	border-bottom-color: #1f5e37;
}

/* =============================================================================
   Empty state (no posts yet)
   ============================================================================= */

.mah-blog__empty {
	text-align: center;
	padding: 80px 24px;
	background: rgba( 255, 255, 255, 0.9 );
	border-radius: 10px;
	box-shadow: 0 2px 20px rgba( 0, 0, 0, 0.06 );
}

/* Italic "AJ" monogram as a decorative glyph */
.mah-blog__empty-monogram {
	font-size: 3rem;
	font-style: italic;
	font-weight: 800;
	color: #2b7f4b;
	opacity: 0.2;
	margin: 0 0 1.25rem;
	line-height: 1;
}

.mah-blog__empty h2 {
	color: #2b7f4b;
	font-style: italic;
	font-size: 1.6rem;
	margin-bottom: 0.75rem;
}

.mah-blog__empty p {
	color: #666;
	font-size: 1rem;
	max-width: 460px;
	margin: 0 auto;
	line-height: 1.8;
}

.mah-blog__empty a {
	color: #2b7f4b;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* =============================================================================
   Pagination
   ============================================================================= */

.mah-blog__pagination {
	margin-top: 3rem;
	text-align: center;
	display: flex;
	justify-content: center;
	gap: 0.45rem;
	flex-wrap: wrap;
}

.mah-blog__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.85rem;
	border-radius: 5px;
	font-size: 0.9rem;
	font-weight: 700;
	color: #2b7f4b;
	text-decoration: none;
	background: rgba( 255, 255, 255, 0.9 );
	border: 1.5px solid rgba( 43, 127, 75, 0.3 );
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.mah-blog__pagination .page-numbers.current,
.mah-blog__pagination .page-numbers:hover {
	background: #2b7f4b;
	color: #ffffff;
	border-color: #2b7f4b;
}

/* =============================================================================
   Success / pending notice (post-creation redirect)
   ============================================================================= */

.mah-blog__notice {
	border-radius: 6px;
	padding: 1rem 1.25rem;
	margin-bottom: 1.75rem;
	font-size: 0.95rem;
	line-height: 1.6;
}

.mah-blog__notice--success {
	background: #dcfce7;
	border-left: 4px solid #2b7f4b;
	color: #166534;
}

.mah-blog__notice--pending {
	background: #fef9c3;
	border-left: 4px solid #ca8a04;
	color: #854d0e;
}

/* =============================================================================
   Write-a-post toolbar & button
   ============================================================================= */

/* ── Toolbar row ────────────────────────────────────────────────────────────── */

/* ── "Log In to Post" button (shown to non-logged-in visitors) ──────────────── */

.mah-blog__login-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.65rem 1.3rem;
	background: var(--btn-primary-bg);
	border-radius: 5px;
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--btn-primary-text);
	text-decoration: none;
	letter-spacing: 0.03em;
	cursor: pointer;
}

.mah-blog__login-btn:hover {
	color: var(--btn-primary-hover-text);
	opacity: 0.88;
}

/* ── Toolbar row ────────────────────────────────────────────────────────────── */

.mah-blog__toolbar {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 1.5rem;
}

/* ── Button ─────────────────────────────────────────────────────────────────── */

.mah-blog__write-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.65rem 1.3rem;
	background: var(--btn-primary-bg);
	border: none;
	border-radius: 5px;
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--btn-primary-text);
	cursor: pointer;
	letter-spacing: 0.03em;
}

.mah-blog__write-btn:hover { color: var(--btn-primary-hover-text); }

.mah-blog__write-btn[aria-expanded="true"] {
	background: #1f5e37;
}

.mah-blog__write-btn-icon {
	font-size: 1.1rem;
	line-height: 1;
}

/* =============================================================================
   New-post collapsible panel
   ============================================================================= */

/* CSS grid trick: animates from 0 to natural height without a fixed max-height */
.mah-blog__new-post-wrap {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.35s ease, margin-bottom 0.35s ease;
	margin-bottom: 0;
	border-radius: 8px;
	overflow: hidden;
}

.mah-blog__new-post-wrap.is-open {
	grid-template-rows: 1fr;
	margin-bottom: 2.5rem;
}

/* The inner div must have overflow: hidden for the grid trick to clip correctly */
.mah-blog__new-post-inner {
	overflow: hidden;
	box-shadow: 0 2px 20px rgba( 0, 0, 0, 0.07 );
	padding: 2rem 2rem 1.75rem;
}

/* ── Form heading ───────────────────────────────────────────────────────────── */

.mah-blog__form-heading {
	font-size: 1.25rem;
	font-style: italic;
	color: #2b7f4b;
	margin: 0 0 1.25rem;
}

/* ── Error list ─────────────────────────────────────────────────────────────── */

.mah-blog__form-errors {
	list-style: none;
	padding: 0.85rem 1rem;
	margin: 0 0 1.25rem;
	background: #fee2e2;
	border-left: 4px solid #dc2626;
	border-radius: 4px;
	color: #991b1b;
	font-size: 0.9rem;
}

.mah-blog__form-errors li + li {
	margin-top: 0.35rem;
}

/* =============================================================================
   Form layout
   ============================================================================= */

/* ── Title + category on one row ────────────────────────────────────────────── */

.mah-blog__form-row {
	display: grid;
	grid-template-columns: 1fr 200px;
	gap: 1rem;
	margin-bottom: 1rem;
}

@media ( max-width: 580px ) {
	.mah-blog__form-row {
		grid-template-columns: 1fr;
	}
}

/* ── Field wrapper ──────────────────────────────────────────────────────────── */

.mah-blog__form-field {
	display: flex;
	flex-direction: column;
	margin-bottom: 1rem;
}

.mah-blog__form-field:last-of-type {
	margin-bottom: 0;
}

/* ── Labels ─────────────────────────────────────────────────────────────────── */

.mah-blog__form-field label {
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #2b7f4b;
	margin-bottom: 0.4rem;
}

.mah-blog__form-field label span[aria-hidden] {
	color: #dc2626;
	margin-left: 2px;
}

/* ── Inputs, select, textarea ───────────────────────────────────────────────── */

.mah-blog__form-field input[type="text"],
.mah-blog__form-field select,
.mah-blog__form-field textarea {
	width: 100%;
	padding: 0.65rem 0.85rem;
	border: 1.5px solid #c8e6d4;
	border-radius: 5px;
	font-size: 0.95rem;
	color: #1a1a1a;
	background: #fff;
	box-sizing: border-box;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
	font-family: inherit;
}

.mah-blog__form-field input:focus,
.mah-blog__form-field select:focus,
.mah-blog__form-field textarea:focus {
	outline: none;
	border-color: #2b7f4b;
	box-shadow: 0 0 0 3px rgba( 43, 127, 75, 0.12 );
}

.mah-blog__form-field select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%232b7f4b' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	padding-right: 2.25rem;
	cursor: pointer;
}

.mah-blog__form-field textarea {
	resize: vertical;
	min-height: 160px;
	line-height: 1.65;
}

/* =============================================================================
   Form actions
   ============================================================================= */

.mah-blog__form-actions {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: 1.25rem;
}

/* ── Submit ─────────────────────────────────────────────────────────────────── */

.mah-blog__form-submit {
	padding: 0.7rem 1.6rem;
	background: #2b7f4b;
	border: none;
	border-radius: 5px;
	font-size: 0.92rem;
	font-weight: 700;
	color: #ffffff;
	cursor: pointer;
	letter-spacing: 0.03em;
	transition: background 0.2s ease;
}

.mah-blog__form-submit:hover {
	background: #1f5e37;
}

/* ── Cancel ─────────────────────────────────────────────────────────────────── */

.mah-blog__form-cancel {
	background: none;
	border: none;
	font-size: 0.88rem;
	font-weight: 600;
	color: #888;
	cursor: pointer;
	padding: 0;
	transition: color 0.18s ease;
}

.mah-blog__form-cancel:hover {
	color: #444;
}
