/**
 * Ruby Web — supplementary component styles.
 * Hand-written (not Tailwind-generated) so it can sit safely on top of the
 * purged assets/css/main.css build without needing to recompile it.
 * Colors mirror the existing Ruby Web design tokens.
 */

/* ------------------------------------------------------------------ */
/* Single post: featured image (single.php)                            */
/* ------------------------------------------------------------------ */
/* Centered, capped at 800px so the 800x400 "ruby-featured" image size
   (functions.php) is never stretched wider than its native size. */
.ruby-featured-image {
	max-width: 800px;
	margin-left: auto;
	margin-right: auto;
}

/* ------------------------------------------------------------------ */
/* Homepage: "کتابخانه مقالات" tabs (template-parts/article-library.php) */
/* ------------------------------------------------------------------ */
.ruby-library-panel.is-hidden {
	display: none;
}

/* ------------------------------------------------------------------ */
/* Elementor-built content offset                                      */
/* ------------------------------------------------------------------ */
/*
 * #main-header (header.php) is `fixed`, so it's removed from normal
 * document flow and sits on top of whatever comes right after it. The
 * theme's own (non-Elementor) templates account for this with a Tailwind
 * pt-24/pt-32 utility on their <main> wrapper — but those specific
 * utility classes only exist in main.css because something else on the
 * site already uses them (main.css is a purged/compiled Tailwind build,
 * not the full framework, so arbitrary utility classes added later in
 * markup silently do nothing unless the build is regenerated).
 *
 * front-page.php, page.php, single.php and page-templates/page-toc.php
 * all render Elementor-built content (the_content()) directly, with no
 * theme wrapper, so Elementor can own full-width/edge-to-edge sections —
 * this class is applied around that content just to push it below the
 * fixed header. 80px matches the header's inner row height (h-20 = 5rem
 * in header.php); adjust here if that height ever changes.
 */
.ruby-elementor-offset {
	padding-top: 80px;
}

/* ------------------------------------------------------------------ */
/* WP admin toolbar offset                                             */
/* ------------------------------------------------------------------ */
/*
 * #main-header (header.php) is `position: fixed`, so it's positioned
 * relative to the viewport and ignores the `padding-top` WordPress core
 * normally adds to `html.wp-toolbar` to make room for the logged-in
 * admin toolbar — the two end up stacked on top of each other instead.
 * `body.admin-bar` is added automatically by body_class() whenever the
 * toolbar is showing, so we shift the fixed header down to match the
 * toolbar's real height (32px desktop, 46px on the same breakpoint
 * WordPress itself switches at, <=782px).
 */
body.admin-bar #main-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar #main-header {
		top: 46px;
	}
}

/* ------------------------------------------------------------------ */
/* AJAX live search                                                    */
/* ------------------------------------------------------------------ */
.ruby-live-search {
	position: relative;
}

.ruby-live-search-panel {
	position: absolute;
	inset-inline: 0;
	top: calc(100% + 10px);
	z-index: 60;
	background: rgba(255, 255, 255, 0.98);
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	box-shadow: 0 20px 45px -12px rgba(15, 23, 42, 0.25);
	max-height: 420px;
	overflow-y: auto;
	backdrop-filter: blur(12px);
	padding: 6px;
}
.dark .ruby-live-search-panel {
	background: rgba(19, 27, 46, 0.98);
	border-color: #2a3550;
}

.ruby-ls-empty,
.ruby-ls-loading {
	padding: 18px 16px;
	text-align: center;
	font-size: 14px;
	color: #76777d;
}
.dark .ruby-ls-empty,
.dark .ruby-ls-loading {
	color: #bec6e0;
}

.ruby-ls-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ruby-ls-item a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	border-radius: 12px;
	text-decoration: none;
	transition: background-color 0.2s ease;
}
.ruby-ls-item a:hover,
.ruby-ls-item a:focus {
	background: #eef4ff;
}
.dark .ruby-ls-item a:hover,
.dark .ruby-ls-item a:focus {
	background: rgba(59, 130, 246, 0.12);
}

.ruby-ls-thumb {
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	border-radius: 10px;
	overflow: hidden;
	background: #dbe9ff;
}
.dark .ruby-ls-thumb {
	background: #1b2540;
}
.ruby-ls-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ruby-ls-meta {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.ruby-ls-title {
	font-size: 14px;
	font-weight: 600;
	color: #0f172a;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.dark .ruby-ls-title {
	color: #fff;
}
.ruby-ls-excerpt {
	font-size: 12px;
	color: #45464d;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.dark .ruby-ls-excerpt {
	color: #bec6e0;
}
.ruby-ls-cat {
	font-size: 11px;
	color: #3b82f6;
}

.ruby-ls-more {
	display: block;
	text-align: center;
	padding: 12px;
	margin-top: 4px;
	border-top: 1px solid #e2e8f0;
	font-size: 13px;
	font-weight: 600;
	color: #3b82f6;
	text-decoration: none;
}
.dark .ruby-ls-more {
	border-color: #2a3550;
}
.ruby-ls-more:hover {
	text-decoration: underline;
}

/* Header compact search */
.ruby-header-search {
	position: absolute;
	top: calc(100% + 10px);
	inset-inline-end: 0;
	width: min(360px, 90vw);
	z-index: 55;
}
.ruby-header-search .ruby-live-search-input {
	width: 100%;
	padding: 12px 44px 12px 16px;
	border-radius: 12px;
	border: 2px solid #e2e8f0;
	background: rgba(255, 255, 255, 0.98);
	box-shadow: 0 12px 30px -10px rgba(15, 23, 42, 0.25);
	font-size: 14px;
}
.dark .ruby-header-search .ruby-live-search-input {
	background: rgba(19, 27, 46, 0.98);
	border-color: #2a3550;
	color: #fff;
}
.ruby-header-search .ruby-live-search-input:focus {
	outline: none;
	border-color: #3b82f6;
}
.ruby-header-search-icon {
	position: absolute;
	inset-inline-end: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: #3b82f6;
	pointer-events: none;
}
.ruby-header-search .ruby-live-search-panel {
	top: calc(100% + 8px);
}

/* ------------------------------------------------------------------ */
/* Desktop-only header search wrapper                                  */
/* The compact floating search (icon → absolutely-positioned dropdown, */
/* width: min(360px, 90vw)) isn't reliably contained by its small icon */
/* anchor on narrow screens and can render partly outside the visible  */
/* viewport. Mobile already has its own full-width search field inside */
/* the hamburger menu, so this version is only needed at md and up.    */
/* ------------------------------------------------------------------ */
.ruby-search-desktop {
	display: none;
}
@media (min-width: 768px) {
	.ruby-search-desktop {
		display: block;
	}
}

/* ------------------------------------------------------------------ */
/* Logged-in user box (header)                                         */
/* Hand-written, like the auth modal below: this previously leaned on  */
/* several Tailwind utility classes (md:block, top-full, invisible,    */
/* min-w-[…], group-focus-within:*) that main.css's purged build never */
/* generated, which silently kept the whole box at display:none on     */
/* every screen size. Rewritten with dedicated classes + a little JS   */
/* (site-extra.js → initUserMenu) so it always renders and opens       */
/* correctly regardless of what main.css does or doesn't contain.      */
/* ------------------------------------------------------------------ */
.ruby-user-box {
	display: none;
	position: relative;
}
@media (min-width: 768px) {
	.ruby-user-box {
		display: block;
	}
}

.ruby-user-trigger {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px 6px 8px;
	border-radius: 999px;
	border: 1px solid #e2e8f0;
	background: #ffffff;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ruby-user-trigger:hover,
.ruby-user-trigger[aria-expanded="true"] {
	border-color: #3b82f6;
	box-shadow: 0 6px 18px -10px rgba(59, 130, 246, 0.5);
}
.dark .ruby-user-trigger {
	background: rgba(19, 27, 46, 0.9);
	border-color: #2a3550;
}
.dark .ruby-user-trigger:hover,
.dark .ruby-user-trigger[aria-expanded="true"] {
	border-color: #3b82f6;
}

.ruby-user-avatar {
	width: 30px;
	height: 30px;
	border-radius: 999px;
	display: block;
	flex-shrink: 0;
}

.ruby-user-name {
	font-size: 14px;
	font-weight: 600;
	color: #0f172a;
	max-width: 110px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.dark .ruby-user-name {
	color: #ffffff;
}

.ruby-user-caret {
	color: #76777d;
	flex-shrink: 0;
	transition: transform 0.2s ease, color 0.2s ease;
}
.dark .ruby-user-caret {
	color: #bec6e0;
}
.ruby-user-trigger[aria-expanded="true"] .ruby-user-caret {
	transform: rotate(180deg);
	color: #3b82f6;
}

.ruby-user-menu {
	position: absolute;
	top: calc(100% + 10px);
	inset-inline-end: 0;
	min-width: 200px;
	padding: 8px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	box-shadow: 0 20px 45px -12px rgba(15, 23, 42, 0.25);
	z-index: 60;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.ruby-user-menu.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.dark .ruby-user-menu {
	background: #131b2e;
	border-color: #2a3550;
	box-shadow: 0 20px 45px -12px rgba(0, 0, 0, 0.5);
}

.ruby-user-menu-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 14px;
	color: #45464d;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}
.ruby-user-menu-link:hover,
.ruby-user-menu-link:focus {
	background: #eef4ff;
	color: #3b82f6;
}
.dark .ruby-user-menu-link {
	color: #bec6e0;
}
.dark .ruby-user-menu-link:hover,
.dark .ruby-user-menu-link:focus {
	background: rgba(59, 130, 246, 0.12);
	color: #3b82f6;
}

.ruby-user-menu-link--danger {
	color: #dc2626;
}
.ruby-user-menu-link--danger:hover,
.ruby-user-menu-link--danger:focus {
	background: rgba(220, 38, 38, 0.08);
	color: #dc2626;
}
.dark .ruby-user-menu-link--danger {
	color: #f87171;
}
.dark .ruby-user-menu-link--danger:hover,
.dark .ruby-user-menu-link--danger:focus {
	background: rgba(248, 113, 113, 0.12);
	color: #f87171;
}

/* Mobile menu logout link (text-red-500 isn't in the purged build). */
.ruby-mobile-logout {
	color: #dc2626;
}
.dark .ruby-mobile-logout {
	color: #f87171;
}

/* ------------------------------------------------------------------ */
/* Article layout: sticky info card + vertical section menu            */
/* ------------------------------------------------------------------ */
.ruby-article-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
	align-items: start;
}
@media (min-width: 1024px) {
	.ruby-article-grid {
		grid-template-columns: minmax(0, 1fr) 300px;
	}
}

.ruby-sticky-col {
	position: static;
}
@media (min-width: 1024px) {
	.ruby-sticky-col {
		position: sticky;
		top: 104px;
	}
}

/* Vertical section jump-menu (right-hand column) */
.ruby-toc-nav {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.ruby-toc-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 13.5px;
	font-weight: 500;
	color: #45464d;
	text-decoration: none;
	border-inline-start: 2px solid transparent;
	transition: all 0.2s ease;
}
.dark .ruby-toc-link {
	color: #bec6e0;
}
.ruby-toc-link:hover {
	background: #eef4ff;
	color: #3b82f6;
}
.dark .ruby-toc-link:hover {
	background: rgba(59, 130, 246, 0.12);
}
.ruby-toc-link.is-active {
	background: #eef4ff;
	color: #3b82f6;
	border-inline-start-color: #3b82f6;
	font-weight: 700;
}
.dark .ruby-toc-link.is-active {
	background: rgba(59, 130, 246, 0.16);
}
.ruby-toc-link .ruby-icon {
	flex: 0 0 auto;
	opacity: 0.85;
}

/* Article meta info-card rows */
.ruby-info-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 0;
	border-bottom: 1px dashed #e2e8f0;
	font-size: 13.5px;
}
.dark .ruby-info-row {
	border-color: #2a3550;
}
.ruby-info-row:last-child {
	border-bottom: none;
}
.ruby-info-row-label {
	display: flex;
	align-items: center;
	gap: 8px;
	color: #45464d;
}
.dark .ruby-info-row-label {
	color: #bec6e0;
}
.ruby-info-row-value {
	font-weight: 700;
	color: #0f172a;
}
.dark .ruby-info-row-value {
	color: #fff;
}

/* ------------------------------------------------------------------ */
/* Tabs                                                                 */
/* ------------------------------------------------------------------ */
.ruby-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	position: sticky;
	top: 84px;
	z-index: 20;
	padding: 8px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid #e2e8f0;
	backdrop-filter: blur(10px);
	margin-bottom: 28px;
}
.dark .ruby-tabs {
	background: rgba(19, 27, 46, 0.9);
	border-color: #2a3550;
}
.ruby-tabs .ruby-toc-link {
	border-inline-start: none;
	border-radius: 999px;
	padding: 8px 16px;
}
.ruby-tabs .ruby-toc-link.is-active {
	background: linear-gradient(90deg, #2563eb, #3b82f6);
	color: #fff;
}

/* ------------------------------------------------------------------ */
/* Accordion (curriculum-style sections)                               */
/* ------------------------------------------------------------------ */
.ruby-accordion-item {
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	overflow: hidden;
	margin-bottom: 10px;
}
.dark .ruby-accordion-item {
	border-color: #2a3550;
}
.ruby-accordion-toggle {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	background: #eef4ff;
	border: none;
	cursor: pointer;
	font-weight: 700;
	font-size: 14px;
	color: #0f172a;
	text-align: right;
}
.dark .ruby-accordion-toggle {
	background: rgba(59, 130, 246, 0.1);
	color: #fff;
}
.ruby-accordion-toggle .ruby-icon {
	transition: transform 0.25s ease;
}
.ruby-accordion-toggle[aria-expanded="true"] .ruby-icon.chevron {
	transform: rotate(-90deg);
}
.ruby-accordion-panel {
	padding: 6px 18px 14px;
}
.ruby-accordion-panel ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.ruby-accordion-panel li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 0;
	border-bottom: 1px solid #e2e8f0;
	font-size: 13.5px;
	color: #45464d;
}
.dark .ruby-accordion-panel li {
	border-color: #2a3550;
	color: #bec6e0;
}
.ruby-accordion-panel li:last-child {
	border-bottom: none;
}

/* ------------------------------------------------------------------ */
/* Rating / feedback                                                    */
/* ------------------------------------------------------------------ */
.ruby-rating-bar-track {
	flex: 1;
	height: 8px;
	border-radius: 999px;
	background: #eef4ff;
	overflow: hidden;
}
.dark .ruby-rating-bar-track {
	background: rgba(59, 130, 246, 0.15);
}
.ruby-rating-bar-fill {
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, #2563eb, #3b82f6);
}

.ruby-rating-widget {
	display: flex;
	align-items: center;
	gap: 6px;
}
.ruby-rating-star {
	background: none;
	border: none;
	cursor: pointer;
	padding: 2px;
	color: #c6c6cb;
	transition: color 0.15s ease, transform 0.15s ease;
}
.dark .ruby-rating-star {
	color: #3a4562;
}
.ruby-rating-star.is-hover {
	color: #f97316;
	transform: scale(1.15);
}
.ruby-rating-widget.is-rated .ruby-rating-star {
	pointer-events: none;
}
.ruby-rating-star svg {
	fill: currentColor;
}
.ruby-rating-msg {
	font-size: 12.5px;
	color: #3b82f6;
	margin-inline-start: 8px;
}

/* Star display (read-only, e.g. average rating / review stars) */
.ruby-star-display {
	display: inline-flex;
	gap: 2px;
	color: #f97316;
}
.ruby-star-display svg {
	fill: currentColor;
}
.ruby-star-display .is-empty {
	color: #dbe9ff;
}
.dark .ruby-star-display .is-empty {
	color: #2a3550;
}

/* ------------------------------------------------------------------ */
/* Comments styled as "reviews"                                        */
/* ------------------------------------------------------------------ */
.ruby-comment {
	display: flex;
	gap: 14px;
	padding: 20px 0;
	border-bottom: 1px solid #e2e8f0;
}
.dark .ruby-comment {
	border-color: #2a3550;
}
.ruby-comment:last-child {
	border-bottom: none;
}
.ruby-comment-avatar img {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	display: block;
}
.ruby-comment-body {
	flex: 1;
	min-width: 0;
}
.ruby-comment-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
}
.ruby-comment-author {
	font-weight: 700;
	color: #0f172a;
	font-size: 14px;
}
.dark .ruby-comment-author {
	color: #fff;
}
.ruby-comment-date {
	font-size: 12px;
	color: #76777d;
}
.dark .ruby-comment-date {
	color: #bec6e0;
}
.ruby-comment-text {
	font-size: 14px;
	line-height: 1.9;
	color: #45464d;
}
.dark .ruby-comment-text {
	color: #d7dcef;
}
.ruby-comment-reply-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-top: 6px;
	font-size: 12.5px;
	font-weight: 600;
	color: #3b82f6;
	text-decoration: none;
}
.ruby-comment-children {
	margin-inline-start: 30px;
	border-inline-start: 2px solid #eef4ff;
	padding-inline-start: 16px;
}
.dark .ruby-comment-children {
	border-color: #2a3550;
}

/* ------------------------------------------------------------------ */
/* Blog / archive sidebar widgets                                      */
/* ------------------------------------------------------------------ */
.ruby-widget {
	background: rgba(255, 255, 255, 0.85);
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 22px;
	margin-bottom: 22px;
}
.dark .ruby-widget {
	background: rgba(19, 27, 46, 0.85);
	border-color: #2a3550;
}
.ruby-widget-title {
	font-size: 16px;
	font-weight: 800;
	margin-bottom: 16px;
	padding-bottom: 10px;
	border-bottom: 1px solid #e2e8f0;
	background: linear-gradient(90deg, #2563eb, #3b82f6, #f97316);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}
.dark .ruby-widget-title {
	border-color: #2a3550;
}
.ruby-widget-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.ruby-widget-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 9px 0;
	border-bottom: 1px dashed #e2e8f0;
	font-size: 13.5px;
}
.dark .ruby-widget-list li {
	border-color: #2a3550;
}
.ruby-widget-list li:last-child {
	border-bottom: none;
}
.ruby-widget-list a {
	color: #45464d;
	text-decoration: none;
}
.dark .ruby-widget-list a {
	color: #d7dcef;
}
.ruby-widget-list a:hover {
	color: #3b82f6;
}
.ruby-widget-count {
	font-size: 11px;
	color: #76777d;
	background: #eef4ff;
	border-radius: 999px;
	padding: 2px 8px;
}
.dark .ruby-widget-count {
	background: rgba(59, 130, 246, 0.15);
	color: #bec6e0;
}

.ruby-popular-post {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px dashed #e2e8f0;
}
.dark .ruby-popular-post {
	border-color: #2a3550;
}
.ruby-popular-post:last-child {
	border-bottom: none;
}
.ruby-popular-post img {
	width: 56px;
	height: 56px;
	border-radius: 10px;
	object-fit: cover;
	flex: 0 0 auto;
}
.ruby-popular-post-title {
	font-size: 13px;
	font-weight: 600;
	color: #0f172a;
	line-height: 1.6;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.dark .ruby-popular-post-title {
	color: #fff;
}

.ruby-tag-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.ruby-tag-cloud a {
	font-size: 12px;
	padding: 6px 12px;
	border-radius: 999px;
	background: #eef4ff;
	color: #3b82f6;
	text-decoration: none;
	border: 1px solid #e2e8f0;
	transition: all 0.2s ease;
}
.dark .ruby-tag-cloud a {
	background: rgba(59, 130, 246, 0.12);
	border-color: #2a3550;
}
.ruby-tag-cloud a:hover {
	background: #3b82f6;
	color: #fff;
}

/* ------------------------------------------------------------------ */
/* Pagination                                                          */
/* ------------------------------------------------------------------ */
.ruby-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
}
.ruby-pagination a,
.ruby-pagination span {
	min-width: 42px;
	height: 42px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	border: 1px solid #e2e8f0;
	font-size: 13.5px;
	font-weight: 600;
	color: #45464d;
	text-decoration: none;
	padding: 0 10px;
}
.dark .ruby-pagination a,
.dark .ruby-pagination span {
	border-color: #2a3550;
	color: #bec6e0;
}
.ruby-pagination a:hover {
	border-color: #3b82f6;
	color: #3b82f6;
}
.ruby-pagination .current {
	background: linear-gradient(90deg, #2563eb, #3b82f6);
	color: #fff;
	border-color: transparent;
}

/* ------------------------------------------------------------------ */
/* Article rendered content (typography for the_content)               */
/* ------------------------------------------------------------------ */
.ruby-content h2 {
	font-size: 24px;
	font-weight: 800;
	margin: 36px 0 16px;
	scroll-margin-top: 110px;
	color: #0f172a;
}
.dark .ruby-content h2 {
	color: #fff;
}
.ruby-content h3 {
	font-size: 19px;
	font-weight: 700;
	margin: 28px 0 12px;
	scroll-margin-top: 110px;
	color: #0f172a;
}
.dark .ruby-content h3 {
	color: #fff;
}
.ruby-content p {
	margin: 0 0 18px;
	line-height: 2;
}
.ruby-content ul,
.ruby-content ol {
	margin: 0 0 18px;
	padding-inline-start: 22px;
	line-height: 2;
}
.ruby-content img {
	border-radius: 14px;
	margin: 20px 0;
}
.ruby-content blockquote {
	margin: 20px 0;
	padding: 16px 20px;
	border-inline-start: 4px solid #3b82f6;
	background: #eef4ff;
	border-radius: 10px;
	font-style: italic;
}
.dark .ruby-content blockquote {
	background: rgba(59, 130, 246, 0.1);
}
.ruby-content a {
	color: #3b82f6;
	text-decoration: underline;
}
.ruby-content code {
	background: #eef4ff;
	padding: 2px 6px;
	border-radius: 6px;
	font-size: 0.9em;
}
.dark .ruby-content code {
	background: rgba(59, 130, 246, 0.15);
}

/* ------------------------------------------------------------------ */
/* Back to top                                                         */
/* ------------------------------------------------------------------ */
.ruby-back-to-top {
	position: fixed;
	inset-inline-end: 24px;
	bottom: 24px;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(90deg, #2563eb, #3b82f6);
	color: #fff;
	box-shadow: 0 12px 25px -8px rgba(37, 99, 235, 0.6);
	opacity: 0;
	pointer-events: none;
	transform: translateY(10px);
	transition: all 0.25s ease;
	z-index: 40;
	border: none;
	cursor: pointer;
}
.ruby-back-to-top.is-visible {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

@media (max-width: 640px) {
	.ruby-header-search {
		width: min(320px, 92vw);
	}
}

/* ------------------------------------------------------------------ */
/* Small utility shim                                                  */
/* The compiled assets/css/main.css is a purged Tailwind build that    */
/* only contains classes already used in the theme's original files.  */
/* The handful of extra utility-style tokens introduced by the new     */
/* templates above are defined here by hand so nothing needs a full    */
/* Tailwind rebuild.                                                    */
/* ------------------------------------------------------------------ */
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }
.font-semibold { font-weight: 600; }
.leading-snug { line-height: 1.375; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-orange-500 { color: #f97316; }
.opacity-90 { opacity: 0.9; }
.scroll-mt-28 { scroll-margin-top: 7rem; }
.top-3 { top: 0.75rem; }
.right-3 { right: 0.75rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-14 { width: 3.5rem; }
.h-14 { height: 3.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-14 { margin-top: 3.5rem; }
.mb-5 { margin-bottom: 1.25rem; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.pt-6 { padding-top: 1.5rem; }
.pt-10 { padding-top: 2.5rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pr-11 { padding-right: 2.75rem; }
.pr-12 { padding-right: 3rem; }
.gap-5 { gap: 1.25rem; }
.gap-x-6 { column-gap: 1.5rem; }
.gap-y-3 { row-gap: 0.75rem; }
.dark\:text-inverse-primary\/80:is(.dark *) { color: rgba(190, 198, 224, 0.8); }

@media (min-width: 640px) {
	.sm\:border-r { border-right-width: 1px; border-right-style: solid; }
	.sm\:border-t-0 { border-top-width: 0; }
	.sm\:pt-0 { padding-top: 0; }
	.sm\:pr-8 { padding-right: 2rem; }
	.sm\:col-span-2 { grid-column: span 2 / span 2; }
}
@media (min-width: 768px) {
	.md\:p-10 { padding: 2.5rem; }
}

/* Card grids: flex-based (not CSS grid) so that an incomplete last row
   stays horizontally centered instead of hugging one side. Used for every
   card/tile gallery across the theme (tools, categories, article grids). */
.ruby-card-grid-4 {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 24px;
}
.ruby-card-grid-4 > * {
	width: 100%;
}
@media (min-width: 640px) {
	.ruby-card-grid-4 > * {
		width: calc(50% - 12px);
	}
}
@media (min-width: 1024px) {
	.ruby-card-grid-4 > * {
		width: calc(25% - 18px);
	}
}

/* Same idea, capped at 2 per row — for the narrower content column next to
   a sticky sidebar (archive/category/tag/search), where 4-up would be cramped. */
.ruby-card-grid-2 {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 24px;
}
.ruby-card-grid-2 > * {
	width: 100%;
}
@media (min-width: 768px) {
	.ruby-card-grid-2 > * {
		width: calc(50% - 12px);
	}
}

/* Semantic layout helpers used by archive/category/search/single templates */
.ruby-blog-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 40px;
	align-items: start;
}
@media (min-width: 1024px) {
	.ruby-blog-layout {
		grid-template-columns: minmax(0, 1fr) 320px;
	}
}

.ruby-feedback-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
	align-items: center;
}
@media (min-width: 640px) {
	.ruby-feedback-grid {
		grid-template-columns: 1fr 180px;
	}
}

.ruby-category-banner {
	background: linear-gradient(120deg, #2563eb, #3b82f6 55%, #f97316);
}

.ruby-comment-list,
.ruby-comment-children {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ------------------------------------------------------------------ */
/* Accessibility: visually-hidden utility                              */
/* (missing from the purged Tailwind build; also used by header.php)   */
/* ------------------------------------------------------------------ */
.sr-only,
.screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* ------------------------------------------------------------------ */
/* Login / registration modal                                          */
/* Deliberately self-contained: does not lean on Tailwind utility      */
/* classes from main.css (that build predates this component — see    */
/* README → "کامپایل مجدد CSS اصلی"), so it renders correctly and      */
/* consistently no matter what main.css does or doesn't contain.       */
/* ------------------------------------------------------------------ */
.ruby-auth-modal {
	position: fixed;
	inset: 0;
	z-index: 999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
.ruby-auth-modal.hidden {
	display: none;
}
.ruby-auth-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(13, 20, 35, 0.6);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

/* Panel */
.ruby-auth-modal-panel {
	position: relative;
	width: 100%;
	max-width: 428px;
	max-height: 90vh;
	overflow-y: auto;
	background: #ffffff;
	border-radius: 20px;
	padding: 34px 28px 28px;
	box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.04);
	animation: ruby-auth-pop 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.dark .ruby-auth-modal-panel {
	background: #0f172a;
	box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.ruby-auth-modal-panel::before {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 4px;
	border-radius: 20px 20px 0 0;
	background: linear-gradient(90deg, #e0115f, #3b82f6 65%, #2563eb);
}
@keyframes ruby-auth-pop {
	from { opacity: 0; transform: translateY(14px) scale(0.97); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 480px) {
	.ruby-auth-modal-panel {
		padding: 28px 20px 22px;
		border-radius: 18px;
	}
}

/* Close button */
.ruby-auth-close {
	position: absolute;
	top: 14px;
	left: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: none;
	border-radius: 999px;
	background: transparent;
	color: #76777d;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}
.ruby-auth-close:hover {
	background: #eef4ff;
	color: #3b82f6;
}
.dark .ruby-auth-close {
	color: rgba(190, 198, 224, 0.8);
}
.dark .ruby-auth-close:hover {
	background: #131b2e;
	color: #60a5fa;
}

/* Welcome header */
.ruby-auth-head {
	text-align: center;
	margin-bottom: 22px;
}
.ruby-auth-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin-bottom: 14px;
	border-radius: 999px;
	background: linear-gradient(135deg, #e0115f, #3b82f6);
	color: #fff;
	box-shadow: 0 8px 20px -6px rgba(224, 17, 95, 0.45);
}
.ruby-auth-title {
	margin: 0 0 6px;
	font-size: 19px;
	font-weight: 800;
	color: #0d1c2d;
}
.dark .ruby-auth-title {
	color: #f8f9ff;
}
.ruby-auth-subtitle {
	max-width: 320px;
	margin: 0 auto;
	font-size: 13.5px;
	line-height: 1.7;
	color: #45464d;
}
.dark .ruby-auth-subtitle {
	color: rgba(190, 198, 224, 0.75);
}

/* Tabs */
.ruby-auth-tabs {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-bottom: 22px;
	padding: 4px;
	background: #eef4ff;
	border-radius: 14px;
}
.dark .ruby-auth-tabs {
	background: #131b2e;
}
.ruby-auth-tab {
	flex: 1;
	padding: 10px 12px;
	border: none;
	border-radius: 10px;
	background: transparent;
	font-size: 13.5px;
	font-weight: 700;
	color: #64748b;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.dark .ruby-auth-tab {
	color: rgba(255, 255, 255, 0.7);
}
.ruby-auth-tab.is-active {
	background: #fff;
	color: #2563eb;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}
.dark .ruby-auth-tab.is-active {
	background: #0f172a;
	color: #60a5fa;
}

/* Alert message */
.ruby-auth-msg {
	margin-bottom: 16px;
	padding: 11px 14px;
	border-radius: 10px;
	border-right: 3px solid transparent;
	font-size: 13px;
	line-height: 1.6;
}
.ruby-auth-msg.is-error {
	background: rgba(239, 68, 68, 0.1);
	border-right-color: #dc2626;
	color: #dc2626;
}
.dark .ruby-auth-msg.is-error {
	background: rgba(239, 68, 68, 0.15);
	border-right-color: #f87171;
	color: #f87171;
}
.ruby-auth-msg.is-success {
	background: rgba(34, 197, 94, 0.1);
	border-right-color: #16a34a;
	color: #16a34a;
}
.dark .ruby-auth-msg.is-success {
	background: rgba(34, 197, 94, 0.15);
	border-right-color: #4ade80;
	color: #4ade80;
}

/* Honeypot (bot trap, must stay invisible but focusable by scripts) */
.ruby-auth-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

/* Form layout */
.ruby-auth-form {
	flex-direction: column;
	gap: 16px;
}
.ruby-auth-field {
	display: block;
}
.ruby-auth-label {
	display: block;
	margin-bottom: 7px;
	font-size: 13px;
	font-weight: 600;
	color: #45464d;
}
.dark .ruby-auth-label {
	color: rgba(190, 198, 224, 0.85);
}
.ruby-auth-input-wrap {
	position: relative;
	display: block;
}
.ruby-auth-icon {
	position: absolute;
	top: 50%;
	right: 14px;
	transform: translateY(-50%);
	display: flex;
	color: #76777d;
	pointer-events: none;
}
.dark .ruby-auth-icon {
	color: rgba(190, 198, 224, 0.65);
}
.ruby-auth-input {
	width: 100%;
	padding: 13px 44px;
	border: 1.5px solid #e2e8f0;
	border-radius: 12px;
	background: transparent;
	font-size: 14px;
	color: #0d1c2d;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ruby-auth-input:not(.ruby-auth-input--pass) {
	padding-left: 16px;
}
.dark .ruby-auth-input {
	border-color: #2a3550;
	color: #f8f9ff;
}
.ruby-auth-input::placeholder {
	color: #9aa0ab;
}
.ruby-auth-input:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.ruby-auth-input.is-invalid {
	border-color: #ef4444 !important;
}
.ruby-auth-toggle-pass {
	position: absolute;
	top: 50%;
	left: 14px;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2px;
	border: none;
	background: transparent;
	color: #76777d;
	cursor: pointer;
}
.ruby-auth-toggle-pass:hover {
	color: #3b82f6;
}
.dark .ruby-auth-toggle-pass {
	color: rgba(190, 198, 224, 0.7);
}

/* Row: remember me + forgot password */
.ruby-auth-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: -2px;
	font-size: 12.5px;
}
.ruby-auth-remember {
	display: flex;
	align-items: center;
	gap: 7px;
	color: #45464d;
	cursor: pointer;
}
.dark .ruby-auth-remember {
	color: rgba(190, 198, 224, 0.85);
}
.ruby-auth-remember input {
	width: 15px;
	height: 15px;
	border-radius: 4px;
	accent-color: #3b82f6;
}
.ruby-auth-link {
	color: #3b82f6;
	font-weight: 600;
	text-decoration: none;
}
.ruby-auth-link:hover {
	text-decoration: underline;
}

/* Submit button */
.ruby-auth-submit {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 4px;
	padding: 13px;
	border: none;
	border-radius: 12px;
	background: linear-gradient(90deg, #2563eb, #3b82f6);
	color: #fff;
	font-size: 14.5px;
	font-weight: 700;
	cursor: pointer;
	transition: box-shadow 0.25s ease, transform 0.25s ease, opacity 0.2s ease;
}
.ruby-auth-submit:hover {
	box-shadow: 0 12px 24px -8px rgba(59, 130, 246, 0.5);
	transform: translateY(-1px);
}
.ruby-auth-submit:disabled {
	opacity: 0.7;
	cursor: progress;
	transform: none;
}

.ruby-auth-hint {
	display: block;
	margin: 6px 2px 0;
	font-size: 11.5px;
	color: #9aa0ab;
}
.ruby-auth-terms {
	margin: 4px 0 0;
	font-size: 11.5px;
	line-height: 1.7;
	color: #9aa0ab;
	text-align: center;
}
.ruby-tag-banner {
	background: linear-gradient(120deg, #7c3aed, #a855f7 55%, #2563eb);
}

/* کوتاه‌تر کردن خط آبی زیر آیتم‌های منو در حالت هاور */
.nav-link:hover:after {
	width: 80px;
}
