/* BeMind Magazine — front-end styles, adapted from the design mockup */

/*
 * The magazine is designed LTR. When the theme forces RTL site-wide,
 * selecting EN in the magazine's own language toggle cancels that
 * inherited direction for the magazine's markup (this stylesheet's
 * .bm-magazine wrapper, used by the single/archive templates); the
 * homepage template carries the equivalent rule for its .bm-mag
 * wrapper in its own inline <style> block. Selecting HE leaves the
 * theme's RTL in place.
 */
.bm-magazine[dir="ltr"] { direction: ltr !important; text-align: left !important; }
.bm-magazine[dir="rtl"] { direction: rtl !important; }

.bm-magazine {
	--bm-ink: #141d52;
	--bm-purple: #4f57e8;
	--bm-purple-dark: #343bc0;
	color: var(--bm-ink);
	font-family: 'DM Sans', system-ui, sans-serif;
	position: relative;
}
.bm-magazine a { color: var(--bm-purple); text-decoration: none; }
.bm-magazine a:hover { color: var(--bm-purple-dark); }

/* Hover states used by bm_mag_render_footer_section()'s social icons
   (also defined in the homepage template's own <style> block, for the
   copies of this markup rendered outside .bm-magazine). */
.bm-magazine .h5:hover, .h5:hover { background: #e2e6fd !important; }
.bm-magazine .h6:hover, .h6:hover { background: #e2e6fd !important; }
.bm-magazine .h7:hover, .h7:hover { background: #e2e6fd !important; }
.bm-magazine h1, .bm-magazine h2, .bm-magazine h3, .bm-magazine h4 {
	font-family: 'Plus Jakarta Sans', sans-serif;
	color: #111a4f;
}

/* Language bar */
.bm-langbar {
	position: fixed; top: 18px; left: 18px; z-index: 60;
	display: flex; align-items: center; gap: 2px; padding: 4px;
	border-radius: 999px; background: rgba(255,255,255,.85);
	border: 1px solid #e6e8fb; box-shadow: 0 4px 16px rgba(63,72,150,.10);
	backdrop-filter: blur(8px); font-size: 12.5px;
}
.bm-langbar a { padding: 3px 10px; border-radius: 999px; color: #8189ad; font-weight: 400; }
.bm-langbar a.bm-lang-active,
.bm-langbar[data-lang="en"] .bm-lang-en,
.bm-langbar[data-lang="he"] .bm-lang-he {
	color: #3a4270; font-weight: 500; background: rgba(85,96,230,.12);
}

/* Hero */
.bm-hero {
	position: relative; overflow: hidden; display: flex; flex-wrap: wrap;
	gap: 40px; align-items: stretch;
	background: linear-gradient(100deg,#f0f1fe 0%,#f6f7ff 45%,#ffffff 100%);
	padding: 88px 0;
}
.bm-hero-inner {
	position: relative; width: 80%; max-width: 1200px; margin: 0 auto;
	display: flex; flex-wrap: wrap; gap: 40px; align-items: center;
}
.bm-hero-text { flex: 1 1 300px; min-width: 0; max-width: 520px; }
.bm-hero-text h1 { font-weight: 800; font-size: 64px; line-height: 1.04; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
.bm-hero-subtitle { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; font-size: 25px; color: #5560e6; margin: 22px 0 0; }
.bm-hero-desc { font-size: 16px; line-height: 1.75; color: #5b648c; margin: 20px 0 0; max-width: 420px; }
.bm-hero-img { position: relative; flex: 1 1 400px; aspect-ratio: 1140/597; }
.bm-hero-img img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Main layout */
.bm-main { max-width: 1200px; margin: 0 auto; padding: 56px 40px 72px; display: flex; flex-wrap: wrap; gap: 36px; align-items: flex-start; }
.bm-primary { flex: 3 1 460px; min-width: 0; }

/* Featured article */
.bm-featured {
	display: flex; flex-wrap: wrap; gap: 28px; padding: 20px;
	border: 1px solid #eaecf9; border-radius: 16px; background: #fff;
	box-shadow: 0 2px 20px rgba(63,72,150,.05);
}
.bm-featured-img { position: relative; flex: 1.7 1 300px; min-width: 260px; min-height: 250px; }
.bm-featured-img img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.bm-featured-body { display: flex; flex-direction: column; gap: 8px; padding: 6px 8px 6px 0; flex: 1 1 250px; min-width: 0; }
.bm-featured-body h2 { font-weight: 700; font-size: 29px; line-height: 1.25; margin: 0; }
.bm-featured-body h2 a { color: inherit; }
.bm-featured-body p { font-size: 15px; line-height: 1.65; color: #5b648c; margin: 0; }
.bm-featured-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: auto; padding-top: 10px; }
.bm-read-link {
	width: 38px; height: 38px; flex: none; border-radius: 50%; border: 1px solid #e6e8fb;
	display: flex; align-items: center; justify-content: center; color: var(--bm-purple);
	font-size: 18px;
}
.bm-read-link:hover { background: rgba(79,87,232,.5); color: #fff; border-color: rgba(79,87,232,.5); }

/* Byline */
.bm-byline { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.bm-byline-photo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.bm-byline-name { font-size: 13px; font-weight: 600; color: #2b3566; }
.bm-byline-role { font-size: 12px; color: #7d86ab; }

/* Section heading */
.bm-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin: 44px 0 10px; }
.bm-section-heading h1, .bm-section-heading h3 { font-weight: 700; font-size: 28px; margin: 0; }
.bm-section-heading a { font-size: 14px; }

/* Article rows */
.bm-row { display: grid; grid-template-columns: minmax(150px,210px) minmax(0,1fr); gap: 24px; padding: 22px 0; border-bottom: 1px solid #eef0f8; align-items: start; }
.bm-row-thumb { position: relative; aspect-ratio: 172/99; background: #eef0fe; border-radius: 8px; overflow: hidden; }
.bm-row-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bm-row-body { display: flex; flex-direction: column; gap: 8px; }
.bm-row-kicker { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; color: #5560e6; }
.bm-row-body h4 { font-weight: 700; font-size: 18px; margin: 0; }
.bm-row-body h4 a { color: inherit; }
.bm-row-dek { font-size: 14px; line-height: 1.6; color: #6b7396; margin: 0; max-width: 460px; }
.bm-row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: #8189ad; margin-top: 2px; }

/* Sidebar cards */
.bm-aside { display: flex; flex-direction: column; gap: 24px; flex: 0 0 310px; min-width: 280px; max-width: 310px; }
.bm-card { border: 1px solid #eaecf9; border-radius: 16px; padding: 24px 22px; background: #fff; }
.bm-card h4 { font-weight: 700; font-size: 19px; margin: 0 0 6px; }

/* Newsletter */
.bm-newsletter { background: linear-gradient(160deg,#FAFAFF,#EFF0FF); border-color: #e6e8fb; padding: 26px 24px 28px; }
.bm-newsletter p { font-size: 13.5px; line-height: 1.6; color: #5b648c; margin: 12px 0 18px; }
.bm-newsletter-form { display: flex; flex-direction: column; gap: 10px; }
.bm-newsletter-form input {
	width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid #dfe2f7;
	border-radius: 9px; background: #fff; font-size: 13.5px; color: #2b3566; outline: none;
	font-family: inherit;
}
.bm-newsletter-form button {
	margin-top: 4px; padding: 13px 16px; border: 0; border-radius: 999px;
	background: linear-gradient(100deg,#5560e6,#6f5bf0); color: #fff;
	font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer;
}
.bm-newsletter-form button:hover { background: linear-gradient(100deg,#414cd6,#5c48e2); }

/* Category browser */
.bm-category-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid #f1f2f9; color: #3a4270; font-size: 14px; }
.bm-category-row:hover { background: #e2e6fd; color: #3a4270; }
.bm-category-icon { width: 34px; height: 34px; border-radius: 50%; background: #eef0fe; flex: none; display: flex; align-items: center; justify-content: center; }
.bm-category-icon img { width: 18px; height: 18px; object-fit: contain; }
.bm-category-name { flex: 1; }
.bm-category-arrow { font-size: 22px; line-height: 1; }

/* CTA box */
.bm-cta { background: linear-gradient(160deg,#f5f4ff,#ebe9fd); border-color: #e9e7fb; padding: 26px 24px; }
.bm-cta p { font-size: 13.5px; line-height: 1.6; color: #5b648c; margin: 12px 0 16px; }
.bm-cta a { font-size: 14px; font-weight: 500; }

/* Quote section */
.bm-quote {
	position: relative; overflow: hidden;
	background: linear-gradient(90deg,#e1e4fb 0%,#f2f3fe 28%,#f8f8ff 50%,#f1f2fe 74%,#e4e6fc 100%);
	padding: 44px 40px; display: flex; align-items: center; justify-content: center;
	gap: 40px; flex-wrap: wrap; text-align: center;
}
.bm-quote p { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 21px; line-height: 1.5; color: #4b53b8; margin: 0; max-width: 520px; }
.bm-social { display: flex; align-items: center; gap: 8px; }
.bm-social a { width: 28px; height: 28px; border-radius: 6px; background: #eef0fe; display: flex; align-items: center; justify-content: center; color: #5560e6; font-size: 11px; font-weight: 700; }
.bm-social a:hover { background: #e2e6fd; }

/* Single article */
.bm-single-wrap { max-width: 760px; margin: 0 auto; padding: 56px 24px 80px; }
.bm-single-title { font-size: 40px; font-weight: 800; line-height: 1.15; margin: 12px 0 0; }
.bm-single-meta { display: flex; align-items: center; gap: 20px; margin: 18px 0; flex-wrap: wrap; }
.bm-single-img { margin: 24px 0; border-radius: 12px; overflow: hidden; }
.bm-single-img img { width: 100%; display: block; }
.bm-single-subtitle { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; font-size: 19px; line-height: 1.5; color: #5560e6; margin: 0 0 24px; }
.bm-single-content { font-size: 17px; line-height: 1.8; color: #2b3566; }
.bm-single-content p { margin: 0 0 20px; }

.bm-share { display: flex; align-items: center; gap: 10px; margin: 32px 0; }
.bm-share-label { font-size: 13px; color: #7d86ab; }
.bm-share-link { width: 32px; height: 32px; border-radius: 50%; background: #eef0fe; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #5560e6; }
.bm-share-link:hover { background: #e2e6fd; }

.bm-writer-bio { display: flex; flex-direction: column; gap: 10px; margin: 32px 0; padding: 22px; background: #f8f8ff; border: 1px solid #eaecf9; border-radius: 14px; }
.bm-writer-bio-text { font-size: 14px; line-height: 1.7; color: #5b648c; }

.bm-prevnext { display: flex; justify-content: space-between; gap: 20px; margin: 32px 0; padding-top: 20px; border-top: 1px solid #eef0f8; font-weight: 600; }
.bm-prevnext-next { margin-left: auto; text-align: right; }

.bm-related { margin-top: 48px; }
.bm-related h3 { font-size: 22px; margin: 0 0 16px; }
.bm-related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 20px; }
.bm-related-card { color: inherit; display: block; }
.bm-related-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
.bm-related-card h4 { font-size: 15px; font-weight: 700; margin: 0; }

/* Archive / pagination */
.bm-archive-wrap { max-width: 1200px; margin: 0 auto; padding: 40px 40px 72px; }
.bm-pagination { display: flex; gap: 8px; margin-top: 24px; }
.bm-pagination .page-numbers { padding: 8px 14px; border: 1px solid #eaecf9; border-radius: 8px; color: #3a4270; }
.bm-pagination .page-numbers.current { background: var(--bm-purple); color: #fff; border-color: var(--bm-purple); }

/* Writer page */
.bm-writer-page { max-width: 640px; margin: 0 auto; padding: 56px 24px; }
.bm-writer-role { color: #7d86ab; font-size: 14px; }

/* Responsive */
@media (max-width: 900px) {
	.bm-aside { flex: 1 1 100%; min-width: 0; max-width: 100%; flex-direction: row; flex-wrap: wrap; }
	.bm-aside > * { flex: 1 1 300px; }
}
@media (max-width: 760px) {
	.bm-main, .bm-archive-wrap { padding: 32px 20px 48px; }
	.bm-aside { flex-direction: column; }
	.bm-row { grid-template-columns: 120px minmax(0,1fr); gap: 14px; }
	.bm-row-kicker, .bm-row-meta { display: none; }
}
@media (max-width: 430px) {
	.bm-hero-text h1, .bm-single-title { font-size: 40px; }
}
