/* RM NATIVE HYBRID CSS */
/* Doctor Button Conversion */
.rm-doctor-link {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	background-color: #b75e7a !important;
	color: #ffffff !important;
	font-weight: 700;
	border: none;
	padding-block: 12px !important;
	padding-inline: 28px !important;
	border-radius: 99px !important;
	transition: all 0.3s ease;
	text-decoration: none !important;
}
.rm-doctor-link:hover {
	background-color: #95465e !important;
	transform: translateY(-2px);
	color: #ffffff !important;
}

/* Javascript Viewport Safari Fix */
#main, .site-main { min-height: 0 !important; }
html, body { min-height: 100vh; min-height: 100svh; }

/* Fix Articles Purple Circles Misalignment */
ul.wp-block-post-template {
	list-style-type: none !important;
	padding: 0 !important;
	margin: 0 !important;
}
ul.wp-block-post-template li {
	padding: 0 !important;
	margin-block-end: 20px !important;
}
ul.wp-block-post-template li::before, ul.wp-block-post-template li::marker {
	display: none !important;
	content: none !important;
}

/* Simplify the 27 Years & DC/PT Badges */
.rm-chip {
	background: transparent !important;
	color: inherit !important;
	padding: 0 !important;
	display: block !important;
	font-size: 1rem !important;
	font-weight: 500 !important;
	margin-block-end: 5px !important;
	opacity: 0.9 !important;
}

/* 0.4.45 (Sina): the numbered badge must sit ON the image corner,
   not below it (the thumb <img> precedes the badge in markup). */
.rm-grid-steps .rm-card { position: relative; }
.rm-grid-steps .rm-step-number {
	position: absolute;
	inset-block-start: 12px;
	inset-inline-start: 12px;
	margin-block-end: 0;
	z-index: 2;
	box-shadow: 0 2px 10px rgba(20, 8, 14, 0.25);
}

/* Step Number Badge */
.rm-step-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 48px;
	block-size: 48px;
	border-radius: 50%;
	background-color: var(--theme-palette-color-1, #B25C82);
	color: #ffffff;
	font-size: 1.25rem;
	font-weight: 700;
	margin-block-end: 12px;
}

/* Fix Latest Posts Height (Make cards equal height) */
.wp-block-post-template .wp-block-post {
    display: flex;
    flex-direction: column;
    block-size: 100%;
}
.wp-block-post-template .wp-block-post .rm-card {
    display: flex;
    flex-direction: column;
    block-size: 100%;
    flex: 1;
}
/* Push content above the button up, so buttons align at bottom */
.wp-block-post-template .wp-block-post .wp-block-post-excerpt {
    flex-grow: 1;
}
.wp-block-post-template .wp-block-post .wp-block-buttons {
    margin-block-start: auto;
}

/* Ensure ALL .rm-card elements have equal heights */
.rm-section .rm-card {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    block-size: 100%;
}

/* Custom Grid for injected cards (Replaces Gutenberg inline columns) */
.rm-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-block-start: 2rem;
}
.rm-card-wrapper {
    display: flex;
    flex-direction: column;
}

/* Enforce identical background color on all cards */
.rm-section .rm-card {
    background-color: var(--rm-color-surface, #FBF7F8) !important;
}

/* 2 columns for Reasons / 3 columns for Steps */
@media (min-width: 768px) {
    .rm-grid-reasons { grid-template-columns: repeat(2, 1fr); }
    .rm-grid-steps   { grid-template-columns: repeat(3, 1fr); }
    .rm-grid-education { grid-template-columns: repeat(3, 1fr); }
}

/* ── Card vertical alignment (Phase 2B / 0.4.5) ───────────────────────────
 * Replaces the brittle min-height-on-heading approach: headings that wrap
 * to 3+ lines broke the grid. Each card is now a column flexbox — the
 * heading centers itself in the leftover space above the excerpt via
 * margin-block auto/0, so 1-line, 2-line and 3-line headings all align.
 * Selectors match the real DOM emitted by reasons.php / steps.php:
 *   .rm-card-wrapper > .rm-card > h3.wp-block-heading + p.wp-block-paragraph
 */
.rm-section .rm-card {
    display: flex;
    flex-direction: column;
}

.rm-section .rm-card h3.wp-block-heading {
    min-block-size: 0;
    margin-block: 0;
}

.rm-section .rm-card p.wp-block-paragraph {
    margin-block-start: 0.75rem;
}

/* Latest Posts cards follow the same flex pattern */
.wp-block-post-template .rm-card {
    display: flex;
    flex-direction: column;
}

.wp-block-post-template .rm-card .wp-block-post-title {
    min-block-size: 0;
    margin-block: 0;
}

/* ── Footer digit localization (Phase 1 / 0.4.4) ──────────────────────────
 * The EN copyright year is emitted by PHP as Western ASCII digits. Persian
 * webfonts can substitute Latin digit glyphs via OpenType features, so on
 * English pages we force lining Latin digits inside the footer copyright.
 * Scoped by the plugin-owned body class added by
 * src/Polylang/Body-Language-Class.php (Polylang adds no language class of
 * its own — verified against live HTML 2026-09-05). calt is intentionally
 * left untouched to avoid altering EN letter shaping. */
body.rm-lang-en .ct-footer-copyright,
body.rm-lang-en .ct-footer-copyright a {
    font-variant-numeric: lining-nums;
    font-feature-settings: "lnum" 1;
    font-family: inherit;
}

/* Education placeholder (Phase 3): the fossil pages carry an empty marker
 * div before the Latest Articles wrapper. Until the deployed plugin renders
 * the education partial into it, keep the empty band invisible; once filled
 * by the partial, :empty no longer matches. */
.rm-section--education:empty {
    display: none;
}

/* ── Blog single post CTA (v0.4.15, Design B — gradient banner) ──
   Palette evidence: live Blocksy globals are --theme-palette-color-1
   #B25C82 and --theme-palette-color-2 #9A4A6F; the previous block used
   the infographic tone #C4546C which is NOT in the site palette. */
.rm-single-cta {
	margin-block-start: 2.5rem;
	padding-block: 2rem;
	padding-inline: 1.75rem;
	border-radius: 16px;
	background: linear-gradient(135deg, #B25C82 0%, #9A4A6F 100%);
	color: #fff;
	text-align: center;
	box-shadow: 0 10px 26px rgba(154, 74, 111, 0.35);
}
.rm-single-cta .rm-cta__title {
	font-size: 1.45rem;
	font-weight: 800;
	margin-block: 0 0.45rem;
	margin-inline: 0;
	color: #fff;
}
.rm-single-cta .rm-cta__lead { margin-block: 0 1.5rem; margin-inline: 0; font-size: 1rem; line-height: 1.9; color: rgba(255, 255, 255, 0.85); }
.rm-single-cta .rm-cta__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	justify-content: center;
}
.rm-single-cta .rm-cta__btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding-block: 0.72rem;
	padding-inline: 1.4rem;
	border-radius: 999px;
	font-size: 0.95rem;
	font-weight: 700;
	text-decoration: none;
	transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.rm-single-cta .rm-cta__btn svg { inline-size: 1.05em; block-size: 1.05em; flex: none; }
.rm-single-cta .rm-cta__btn--call {
	background: #fff;
	color: #9A4A6F;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.rm-single-cta .rm-cta__btn--mail,
.rm-single-cta .rm-cta__btn--ig {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	border: 1.5px solid rgba(255, 255, 255, 0.55);
}
.rm-single-cta .rm-cta__btn:hover { transform: translateY(-2px); }
.rm-single-cta .rm-cta__btn--mail:hover,
.rm-single-cta .rm-cta__btn--ig:hover { background: rgba(255, 255, 255, 0.22); }
.rm-single-cta .rm-cta__btn:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.6); outline-offset: 2px; }
.rm-single-cta bdi { font-weight: 600; }
@media (max-width: 600px) {
	.rm-single-cta .rm-cta__btn { flex: 1 1 100%; justify-content: center; }
}

/* ── Blog single-post readable width (v0.4.15) ───────────────────
   Evidence: post singles render inside [data-content=narrow] whose
   --theme-narrow-container-max-width is 400px on the live site — too
   narrow for long-form reading (typographic target ≈ 720px). Scoped
   var override touches ONLY the text column of single posts on
   desktop; Blocksy's alignwide/boxed mechanics stay untouched. */
@media (min-width: 1000px) {
	body.single-post [data-content="narrow"] {
		--theme-narrow-container-max-width: 720px;
	}
}


/* ==========================================================================
   VIS-09 unified rail system (0.4.28): ONE rule-set for every rail
   (Education partial + Latest-articles rebuilt cards) + modern card
   detailing (soft frame, hover lift, image zoom, peek on mobile).
   Pattern basis: CSS scroll-snap flex rails with mandatory snapping,
   ~80% card width on small screens so the next card peeks in.
   ========================================================================== */

:root {
	--rm-card-radius: 14px;
	--rm-card-border: rgba(178, 92, 130, 0.14);
	--rm-rail-gap: 20px;
}

/* ---- Card detailing (all plugin cards: home rails + related) ---- */
.rm-card {
	overflow: hidden;
	border-radius: var(--rm-card-radius);
	border: 1px solid var(--rm-card-border);
	box-shadow: 0 1px 2px rgba(20, 8, 14, 0.04);
	transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.rm-card:hover,
.rm-card:focus-visible {
	transform: translateY(-3px);
	border-color: rgba(178, 92, 130, 0.35);
	box-shadow: 0 14px 30px rgba(154, 74, 111, 0.16);
}
.rm-card {
	overflow: hidden; /* clip the thumb to the card's rounded corners */
}

.rm-card .rm-card-thumb {
	border-radius: calc(var(--rm-card-radius, 14px) - 1px);
	transition: transform 0.35s ease;
	margin-block-end: 0;
	aspect-ratio: 16 / 9;
	inline-size: 100%;
	object-fit: cover;
	display: block;
}
.rm-card:hover .rm-card-thumb,
.rm-card:focus-visible .rm-card-thumb {
	transform: scale(1.04);
}
.rm-card h3.wp-block-heading {
	padding-inline: 1.1rem;
	padding-block-start: 0.95rem;
	font-size: 1.02rem;
	line-height: 1.6;
}
.rm-card p.wp-block-paragraph {
	padding-inline: 1.1rem;
	padding-block-end: 1.05rem;
	font-size: 0.92rem;
	line-height: 1.85;
	color: rgba(0, 0, 0, 0.62);
}

/* ---- Unified rail: any [data-rm-rail] element (div or ul) ---- */
[data-rm-rail] {
	display: flex;
	gap: var(--rm-rail-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	padding-block: 6px 4px; /* headroom so the hover lift never triggers a vertical scrollbar */
}
[data-rm-rail]::-webkit-scrollbar {
	display: none;
}
[data-rm-rail] > .rm-card-wrapper,
[data-rm-rail] > li {
	flex: 0 0 auto;
	scroll-snap-align: start;
	/* Width relative to the rail itself (not vw): the next card ALWAYS
	   peeks ~44px past the gap on every viewport, regardless of the
	   theme's container padding. Capped for tablets. */
	inline-size: min(calc(100% - 64px), 420px);
}
/* Last child snaps flush to the rail end - no blank strip after it. */
[data-rm-rail] > .rm-card-wrapper:last-child,
[data-rm-rail] > li:last-child {
	scroll-snap-align: end;
}
/* Desktop: rails always visible; card width fills a 3-up page (6 cards = 2 pages). */
@media (min-width: 900px) {
	[data-rm-rail] > .rm-card-wrapper,
	[data-rm-rail] > li {
		inline-size: calc((100% - 2 * var(--rm-rail-gap)) / 3);
	}
	.rm-rail-frame {
		margin-inline: 8px;
	}
}
/* Static mode (JS-managed): every card fits - clean grid, nav hidden. */
[data-rm-rail].is-static {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	overflow: visible;
}
[data-rm-rail].is-static > .rm-card-wrapper,
[data-rm-rail].is-static > li {
	inline-size: auto;
}
@media (max-width: 899px) {
	[data-rm-rail].is-static {
		grid-template-columns: 1fr;
	}
}

/* ---- Frame + side arrow buttons (professional, vertically centered) ---- */
.rm-rail-frame {
	position: relative;
}
.rm-rail-frame .rm-rail-nav {
	position: absolute;
	inset-inline: 0;
	inset-block-start: 50%;
	transform: translateY(-50%);
	display: flex;
	justify-content: space-between;
	margin: 0;
	padding-inline: 2px;
	pointer-events: none;
}
.rm-rail-frame .rm-rail-nav[hidden] {
	display: none;
}
.rm-rail-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 42px;
	block-size: 42px;
	padding: 0;
	border: 1px solid var(--theme-palette-color-5);
	border-radius: 999px;
	background: var(--theme-palette-color-8, #fff);
	color: var(--theme-palette-color-3);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(20, 8, 14, 0.14);
	transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
	pointer-events: auto;
}
.rm-rail-btn:hover,
.rm-rail-btn:focus-visible {
	background: var(--theme-palette-color-1, #b25c82);
	border-color: var(--theme-palette-color-1, #b25c82);
	color: #fff;
	transform: scale(1.06);
}
/* On mobile, overlay arrows steal tap area: hide them, swipe is native. */
@media (max-width: 700px) {
	.rm-rail-frame .rm-rail-nav {
		display: none;
	}
}

/* ---- Related-posts cards ride the same detailing ---- */
.rm-related__item .rm-related__thumb {
	border-radius: 10px;
}

/* ---- Reasons section (0.4.34): ONE desktop row of 4 (Sina) ----
   4-up card width so all four fit exactly (JS flips to is-static and
   hides the arrows); a 5th card someday re-activates the rail. */
@media (min-width: 900px) {
	/* :not(.is-static) is REQUIRED - without it this equal-specificity,
	   later-in-file width leaked into static grid mode and squeezed each
	   card to a sliver (one letter per line, Sina 0.4.34 report). */
	[data-rm-rail].rm-grid-reasons:not(.is-static) > .rm-card-wrapper {
		inline-size: calc((100% - 3 * var(--rm-rail-gap)) / 4);
	}
}
[data-rm-rail].rm-grid-reasons.is-static {
	grid-template-columns: repeat(4, 1fr);
}
/* Tablet static fallback: 2x2 instead of a long single column. */
@media (max-width: 899px) {
	[data-rm-rail].rm-grid-reasons.is-static {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* ============ Service archive cards (Sina 2026-09-09) ============ */
/* Blocksy cards ship sharp-cornered and show author/date meta on the  */
/* service archive. Rounded + hairline border to match brand cards;    */
/* meta hidden there (author/date add noise on service listings).      */


/* 0.4.46 (Sina): blog home + category archive cards get the same
   rounded-corner language as the service archive. */
.blog .entries .entry-card,
.archive .entries .entry-card {
	border-radius: var(--theme-border-radius, 14px);
	border: 1px solid var(--theme-palette-color-5, rgba(0, 0, 0, 0.08));
	background: var(--theme-palette-color-8, #fff);
	overflow: hidden;
}
.blog .entries .entry-card .ct-media-container,
.blog .entries .entry-card .post-thumbnail,
.archive .entries .entry-card .ct-media-container,
.archive .entries .entry-card .post-thumbnail {
	border-radius: inherit;
	overflow: hidden;
}

/* Service archive grid layout (v0.6.2) */
.post-type-archive-service .entries[data-layout="grid"] {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--grid-gap, 30px);
}
@media (max-width: 999.98px) {
	.post-type-archive-service .entries[data-layout="grid"] {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (max-width: 699.98px) {
	.post-type-archive-service .entries[data-layout="grid"] {
		grid-template-columns: 1fr;
	}
}

.post-type-archive-service .entries .entry-card {
	border-radius: var(--theme-border-radius, 14px);
	border: 1px solid var(--theme-palette-color-5, rgba(0, 0, 0, 0.08));
	background: var(--theme-palette-color-8, #fff);
	overflow: hidden;
}

.post-type-archive-service .entries .entry-card .ct-media-container,
.post-type-archive-service .entries .entry-card .post-thumbnail {
	border-radius: inherit;
	overflow: hidden;
}

.post-type-archive-service .entries .entry-card .entry-meta {
	display: none;
}

/* Single profile pages (doctor/service/location): the author/date row is
   editorial noise on a clinical profile — hidden on all three (0.4.41).
   Blog/education posts too (Sina 0.4.42: no author/date there either). */
.single-doctor .entry-meta,
.single-service .entry-meta,
.single-location .entry-meta,
.single-post .entry-meta {
	display: none;
}

/* ==========================================================================
   Patient Education: Hide Author & Date / entry-meta (Category 60/62)
   ========================================================================== */
body.category-60 .entry-meta,
body.category-62 .entry-meta,
body.category-patient-education-fa .entry-meta,
body.category-patient-education-en .entry-meta,
body.category-patient-education .entry-meta,
body.single-post.in-category-60 .entry-meta,
body.single-post.in-category-62 .entry-meta,
body.single-post.in-category-patient-education-fa .entry-meta,
body.single-post.in-category-patient-education-en .entry-meta,
body.single-post.in-category-patient-education .entry-meta,
body.single-post.category-60 .entry-meta,
body.single-post.category-62 .entry-meta,
body.single.in-category-60 .entry-meta,
body.single.in-category-62 .entry-meta,
body.single.in-category-patient-education-fa .entry-meta,
body.single.in-category-patient-education-en .entry-meta,
body.category-60 .entry-card .entry-meta,
body.category-62 .entry-card .entry-meta,
body.category-60 .ct-meta-element,
body.category-62 .ct-meta-element,
body.single-post.in-category-60 .ct-meta-element,
body.single-post.in-category-62 .ct-meta-element,
body.category-60 [data-meta],
body.category-62 [data-meta],
body.single-post.in-category-60 [data-meta],
body.single-post.in-category-62 [data-meta] {
	display: none !important;
}

/* ==========================================================================
   Typography Guard: Professional responsive font-sizes and clamp scales
   ========================================================================== */
:root {
	--rm-text-display: clamp(1.85rem, 3.8vw, 2.75rem);
	--rm-text-h1: clamp(1.6rem, 3.2vw, 2.25rem);
	--rm-text-h2: clamp(1.35rem, 2.4vw, 1.75rem);
	--rm-text-h3: clamp(1.1rem, 1.8vw, 1.35rem);
	--rm-chip-font-size: clamp(0.8125rem, 0.9vw, 0.875rem);
	--rm-related-title-size: clamp(1.15rem, 2vw, 1.35rem);
}

.entry-header h1.entry-title,
.single h1.entry-title,
.page h1.entry-title {
	font-size: clamp(1.6rem, 3.2vw, 2.25rem);
	line-height: 1.3;
	font-weight: 700;
}

.entries .entry-card .entry-title,
.entries .entry-card .entry-title a {
	font-size: clamp(1.05rem, 1.5vw, 1.25rem);
	line-height: 1.45;
}

/* ==========================================================================
   Footer Copyright & Ravik Link Styling
   ========================================================================== */
.ct-footer-copyright,
.site-footer-copyright,
[data-id="copyright"],
.footer-copyright {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	text-align: center;
}

.ct-footer-copyright p,
.site-footer-copyright p,
[data-id="copyright"] p,
.footer-copyright p {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px 8px;
	margin-block: 0;
	margin-inline: 0;
	text-align: center;
	line-height: 1.5;
}

.ct-footer-copyright a,
.site-footer-copyright a,
[data-id="copyright"] a,
.footer-copyright a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.15s ease;
}

.ct-footer-copyright a:hover,
.site-footer-copyright a:hover,
[data-id="copyright"] a:hover,
.footer-copyright a:hover {
	color: var(--theme-palette-color-1, #B25C82);
}

.rm-footer-logo {
	height: 20px !important;
	max-height: 20px !important;
	width: auto;
	vertical-align: middle;
	display: inline-block;
	flex-shrink: 0;
	margin-inline-end: 6px;
	object-fit: contain;
}

.rm-copyright-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	vertical-align: middle;
	text-decoration: underline;
	text-underline-offset: 3px;
	white-space: nowrap;
	flex-shrink: 0;
}

@media (max-width: 600px) {
	.ct-footer-copyright,
	.site-footer-copyright,
	[data-id="copyright"],
	.footer-copyright {
		gap: 6px;
	}

	.ct-footer-copyright p,
	.site-footer-copyright p,
	[data-id="copyright"] p,
	.footer-copyright p {
		gap: 4px 6px;
		line-height: 1.6;
	}
}


