/*
 * Mindset Growth Hub: generic WordPress templates (blog posts, plain pages, archives,
 * search, 404). Built from the design tokens of final.html: Tajawal, navy #14244B,
 * blue #3A66AE, amber #F6AB1C, the logo "bar" shape and the course-card style.
 *
 * Written left-to-right; rtl.css flips the directional rules for Arabic pages.
 */

body.mgh-generic {
	--g-primary: #3A66AE;
	--g-primary-dark: #2B4F8C;
	--g-navy: #14244B;
	--g-amber: #F6AB1C;
	--g-amber-hover: #FFBB33;
	--g-sky: #BCD6EC;
	--g-sky-soft: #E4EFF9;
	--g-bg: #F4F7FC;
	--g-muted: #55627F;
	--g-line: #DDE6F2;
	--g-ease: cubic-bezier(.2,.7,.2,1);
	margin: 0;
	font-family: Tajawal, "Segoe UI", Tahoma, sans-serif;
	font-size: 17px;
	line-height: 1.8;
	color: var(--g-navy);
	background: var(--g-bg);
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
}
.mgh-generic *, .mgh-generic *::before, .mgh-generic *::after { box-sizing: border-box; }
.mgh-generic img { max-width: 100%; height: auto; }
.mgh-generic a { color: inherit; }
.mgh-generic :focus-visible { outline: 3px solid var(--g-amber); outline-offset: 3px; border-radius: 6px; }

.g-wrap { width: min(100% - 40px, 1200px); margin-left: auto; margin-right: auto; position: relative; z-index: 1; }
.g-narrow { max-width: 860px; }
.g-main { padding-bottom: clamp(56px, 8vw, 96px); }

/* ---------- Page header band ---------- */
.g-hero, .g-404 {
	position: relative;
	overflow: hidden;
	color: #fff;
	padding: clamp(48px, 7vw, 84px) 0 clamp(88px, 10vw, 120px);
	background:
		radial-gradient(ellipse 60% 70% at 12% 0%, rgba(58,102,174,.55), transparent 60%),
		radial-gradient(ellipse 40% 60% at 95% 100%, rgba(246,171,28,.16), transparent 60%),
		linear-gradient(135deg, #1B3366 0%, #14244B 48%, #0E1A3A 100%);
}
.g-bars { position: absolute; right: 5%; top: -60px; display: flex; gap: 18px; opacity: .16; pointer-events: none; direction: ltr; }
.g-bars i { width: 74px; height: 230px; border-radius: 10px 999px 999px 999px; background: #fff; animation: g-drift 14s ease-in-out infinite; }
.g-bars i:nth-child(2) { background: var(--g-amber); margin-top: 46px; animation-delay: -5s; }
.g-bars i:nth-child(3) { background: var(--g-sky); margin-top: 92px; animation-delay: -9s; }
@keyframes g-drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }
.g-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: .95rem; color: #C9D6EE; margin-bottom: 14px; }
.g-crumbs a { text-decoration: none; transition: color .2s; }
.g-crumbs a:hover { color: var(--g-amber); }
.g-crumbs [aria-current] { color: #fff; font-weight: 700; }
.g-hero h1, .g-404 h1 { margin: 0; font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 800; line-height: 1.3; max-width: 22ch; }
.g-hero h1 span { color: var(--g-amber); }
.g-sub { margin: 14px 0 0; color: #C9D6EE; font-size: 1.08rem; max-width: 62ch; }
.g-sub p { margin: 0; }

/* ---------- Single post / page ---------- */
.g-entry { margin-top: -56px; background: #fff; border-radius: 28px; padding: clamp(24px, 4.5vw, 52px); box-shadow: 0 14px 34px -12px rgba(20,36,75,.22); }
.g-thumb { margin: 0 0 28px; border-radius: 20px; overflow: hidden; }
.g-thumb img { display: block; width: 100%; }
.g-meta { color: var(--g-muted); font-size: .92rem; font-weight: 500; }
.g-hero .g-meta { color: #C9D6EE; }
.g-content > :first-child { margin-top: 0; }
.g-content > :last-child { margin-bottom: 0; }
.g-content p, .g-content ul, .g-content ol, .g-content blockquote, .g-content figure, .g-content table, .g-content pre { margin: 0 0 1.3em; }
.g-content h2, .g-content h3, .g-content h4 { line-height: 1.35; margin: 1.6em 0 .6em; font-weight: 800; }
.g-content h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.g-content h3 { font-size: 1.35rem; }
.g-content a { color: var(--g-primary-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.g-content a:hover { color: var(--g-primary); }
.g-content ul, .g-content ol { padding-left: 1.4em; }
.g-content li { margin-bottom: .4em; }
.g-content blockquote { padding: 18px 24px; border-left: 4px solid var(--g-amber); background: var(--g-sky-soft); border-radius: 0 16px 16px 0; font-size: 1.1rem; }
.g-content blockquote p:last-child { margin-bottom: 0; }
.g-content img { border-radius: 16px; }
.g-content figcaption, .g-content .wp-caption-text { color: var(--g-muted); font-size: .9rem; text-align: center; margin-top: 8px; }
.g-content table { width: 100%; border-collapse: collapse; font-size: .96rem; }
.g-content th, .g-content td { border: 1px solid var(--g-line); padding: 10px 14px; text-align: left; }
.g-content th { background: var(--g-bg); }
.g-content code { background: var(--g-bg); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.g-content pre { background: var(--g-navy); color: #E4EDF9; padding: 18px 20px; border-radius: 16px; overflow-x: auto; direction: ltr; text-align: left; }
.g-content pre code { background: none; padding: 0; }
.g-content hr { border: 0; border-top: 1px solid var(--g-line); margin: 2em 0; }
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.sticky .g-card-body h2::before { content: "★ "; color: var(--g-amber); }

.g-terms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--g-line); }
.g-terms a { padding: 6px 14px; border-radius: 999px; background: var(--g-sky-soft); color: var(--g-primary-dark); font-weight: 700; font-size: .86rem; text-decoration: none; }
.g-terms a:hover { background: var(--g-primary); color: #fff; }

.mgh-generic .post-navigation { margin-top: 28px; }
.mgh-generic .post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mgh-generic .post-navigation a { display: block; height: 100%; padding: 18px 22px; background: #fff; border: 1px solid var(--g-line); border-radius: 18px; text-decoration: none; transition: border-color .25s, transform .25s var(--g-ease); }
.mgh-generic .post-navigation a:hover { border-color: var(--g-primary); transform: translateY(-3px); }
.mgh-generic .post-navigation small { display: block; color: var(--g-muted); font-weight: 600; }
.mgh-generic .post-navigation b { display: block; line-height: 1.5; }
.mgh-generic .post-navigation .nav-next { text-align: right; grid-column: 2; }

/* ---------- Post cards (course-card style) ---------- */
.g-grid { margin-top: -56px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.g-card { background: #fff; border: 1px solid var(--g-line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 2px 10px rgba(20,36,75,.06); transition: transform .35s var(--g-ease), box-shadow .35s, border-color .35s; }
.g-card:hover { transform: translateY(-8px); box-shadow: 0 30px 60px -24px rgba(20,36,75,.38); border-color: var(--g-sky); }
.g-card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--g-primary); position: relative; }
.g-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s var(--g-ease); }
.g-card:hover .g-card-media img { transform: scale(1.08); }
.g-card-art { position: absolute; inset: 0; }
.g-card-art::before, .g-card-art::after { content: ""; position: absolute; width: 74px; height: 170px; border-radius: 8px 999px 999px 999px; background: rgba(255,255,255,.18); top: -30px; right: 34px; }
.g-card-art::after { right: 122px; top: -70px; background: var(--g-amber); opacity: .85; }
.g-card:nth-child(3n+2) .g-card-media { background: var(--g-navy); }
.g-card:nth-child(3n+3) .g-card-media { background: var(--g-sky); }
.g-card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.g-card-body h2 { margin: 0; font-size: 1.25rem; line-height: 1.45; font-weight: 800; }
.g-card-body h2 a { text-decoration: none; }
.g-card-body h2 a:hover { color: var(--g-primary); }
.g-card-body p { margin: 0; color: var(--g-muted); font-size: .96rem; }
.g-more { margin-top: auto; align-self: flex-start; display: inline-flex; gap: 8px; align-items: center; padding: 9px 18px; border-radius: 999px; background: var(--g-sky-soft); color: var(--g-primary-dark); font-weight: 700; text-decoration: none; transition: background .25s, color .25s; }
.g-card:hover .g-more { background: var(--g-primary); color: #fff; }

/* ---------- Pagination (same look as the courses pager) ---------- */
.g-pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 40px; flex-wrap: wrap; }
.g-pager .page-numbers, .g-pager > a, .g-pager > span { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; font-weight: 700; background: #fff; border: 1px solid var(--g-line); color: var(--g-navy); display: inline-grid; place-items: center; text-decoration: none; transition: background .2s, border-color .2s, color .2s; }
.g-pager a.page-numbers:hover, .g-pager > a:hover { border-color: var(--g-primary); color: var(--g-primary); }
.g-pager .current, .g-pager > span.post-page-numbers { background: #0F2A55; border-color: #0F2A55; color: #fff; }
.g-pager .dots { border: 0; background: none; }

/* ---------- Buttons, search, empty state ---------- */
.g-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.g-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px; font: inherit; font-weight: 700; text-decoration: none; border: 0; cursor: pointer; transition: transform .25s var(--g-ease), background .25s, box-shadow .25s; }
.g-btn-primary { background: var(--g-amber); color: var(--g-navy); box-shadow: 0 10px 24px -10px rgba(246,171,28,.8); }
.g-btn-primary:hover { background: var(--g-amber-hover); transform: translateY(-2px); }
.g-btn-ghost { color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.g-btn-ghost:hover { box-shadow: inset 0 0 0 2px #fff; }

.mgh-generic .search-form { display: flex; gap: 10px; max-width: 560px; margin-top: 18px; }
.mgh-generic .search-form label { flex: 1; }
.mgh-generic .search-field { width: 100%; min-height: 52px; padding: 0 18px; border: 1px solid var(--g-line); border-radius: 999px; font: inherit; color: inherit; background: #fff; }
.mgh-generic .search-field:focus { outline: 3px solid var(--g-sky); border-color: var(--g-primary); }
.mgh-generic .search-submit { min-height: 52px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--g-primary); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.mgh-generic .search-submit:hover { background: var(--g-primary-dark); }
.g-search { margin: -56px 0 40px; position: relative; z-index: 2; background: #fff; border-radius: 24px; padding: 18px 22px; box-shadow: 0 14px 34px -12px rgba(20,36,75,.22); }
.g-search .search-form { margin-top: 0; max-width: none; }
.g-search + .g-grid { margin-top: 0; }
.g-empty { margin-top: -56px; background: #fff; border-radius: 28px; padding: clamp(28px, 5vw, 56px); text-align: center; box-shadow: 0 14px 34px -12px rgba(20,36,75,.22); }
.g-empty h2 { margin: 0 0 8px; font-size: 1.6rem; }
.g-empty p { margin: 0; color: var(--g-muted); }
.g-empty .search-form { margin: 24px auto 0; }

/* ---------- 404 ---------- */
.g-404 { padding: clamp(72px, 10vw, 130px) 0; text-align: center; }
.g-404 h1, .g-404 .g-sub { margin-left: auto; margin-right: auto; }
.g-404 .g-actions { justify-content: center; }
.g-404-code { margin: 0; font-size: clamp(5rem, 16vw, 10rem); font-weight: 800; line-height: 1; color: var(--g-amber); letter-spacing: -.02em; }

/* ---------- Comments ---------- */
.g-comments { margin-top: 32px; background: #fff; border-radius: 28px; padding: clamp(24px, 4vw, 44px); box-shadow: 0 2px 10px rgba(20,36,75,.06); }
.g-comments-title, .g-comments .comment-reply-title { margin: 0 0 18px; font-size: 1.4rem; }
.g-comment-list { list-style: none; margin: 0 0 28px; padding: 0; }
.g-comment-list .children { list-style: none; padding-left: 28px; }
.g-comment-list .comment-body { padding: 18px 0; border-bottom: 1px solid var(--g-line); }
.g-comment-list .avatar { border-radius: 50%; float: left; margin-right: 14px; }
.g-comment-list .comment-meta { font-size: .9rem; color: var(--g-muted); }
.g-comment-list .fn { color: var(--g-navy); font-style: normal; font-weight: 700; }
.g-comment-list .reply a { font-weight: 700; color: var(--g-primary-dark); }
.g-comments label { display: block; font-weight: 700; margin-bottom: 6px; }
.g-comments input[type="text"], .g-comments input[type="email"], .g-comments input[type="url"], .g-comments textarea { width: 100%; padding: 12px 16px; border: 1px solid var(--g-line); border-radius: 14px; font: inherit; color: inherit; background: #FBFCFE; }
.g-comments textarea { min-height: 140px; }
.g-comments .comment-form-cookies-consent label { display: inline; font-weight: 500; }

@media (max-width: 640px) {
	body.mgh-generic { font-size: 16px; }
	.mgh-generic .post-navigation .nav-links { grid-template-columns: 1fr; }
	.mgh-generic .post-navigation .nav-next { grid-column: auto; }
	.mgh-generic .search-form { flex-direction: column; }
	.g-bars { opacity: .08; }
}
@media (prefers-reduced-motion: reduce) {
	.mgh-generic *, .mgh-generic *::before, .mgh-generic *::after { animation: none !important; transition-duration: .01ms !important; }
}
