/**
 * Frontend styles — اطلس آزمایشگاهی
 */

:root {
	--mla-fe-primary: #0d7c8c;
	--mla-fe-primary-dark: #0a5f6b;
	--mla-fe-primary-soft: #e8f6f8;
	--mla-fe-border: #d8e2e8;
	--mla-fe-text: #1d2327;
	--mla-fe-muted: #5c6b73;
	--mla-fe-shadow: 0 8px 28px rgba(15, 45, 55, 0.08);
	--mla-fe-radius: 14px;
	--mla-toc-toggle-green: #00843d;
	--mla-toc-toggle-green-hover: #006b31;
	--mla-toc-toggle-red: #c62828;
	--mla-toc-toggle-red-hover: #a82020;
	--mla-toc-toggle-chapter-green: #34c759;
	--mla-toc-toggle-chapter-green-hover: #2db84e;
	--mla-toc-toggle-chapter-red: #ff6b6b;
	--mla-toc-toggle-chapter-red-hover: #f25555;
}

.mla-atlas-wrap {
	max-width: 1080px;
	margin: 0 auto;
	padding: 28px 16px 56px;
	scroll-behavior: smooth;
}

/* Preview banner */
.mla-atlas-preview-banner {
	position: sticky;
	top: 0;
	z-index: 9999;
	background: linear-gradient(90deg, #b45309, #d97706);
	color: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.mla-atlas-preview-banner-inner {
	max-width: 1080px;
	margin: 0 auto;
	padding: 10px 16px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	font-size: 14px;
}

.mla-atlas-preview-banner .dashicons {
	color: #fff;
}

/* Hero */
.mla-atlas-hero {
	margin-bottom: 28px;
	padding: 24px;
	background: linear-gradient(180deg, #fff 0%, #f8fbfc 100%);
	border: 1px solid var(--mla-fe-border);
	border-radius: var(--mla-fe-radius);
	box-shadow: var(--mla-fe-shadow);
}

.mla-atlas-meta-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 14px;
}

.mla-atlas-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	border-radius: 999px;
	font-size: 13px;
	text-decoration: none;
}

.mla-atlas-badge-date {
	background: #f0f4f8;
	color: var(--mla-fe-muted);
}

.mla-atlas-badge-cat {
	background: var(--mla-fe-primary-soft);
	color: var(--mla-fe-primary-dark);
	font-weight: 600;
}

.mla-atlas-badge-cat:hover {
	background: var(--mla-fe-primary);
	color: #fff;
}

.mla-atlas-title {
	margin: 0 0 16px;
	font-size: clamp(1.6rem, 2.8vw, 2.2rem);
	line-height: 1.4;
	font-weight: 800;
	color: var(--mla-fe-text);
}

.mla-atlas-meta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 14px 20px;
	padding: 14px 0 0;
	border-top: 1px solid var(--mla-fe-border);
	font-size: 14px;
	color: var(--mla-fe-muted);
}

.mla-atlas-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.mla-atlas-meta-item .dashicons {
	color: var(--mla-fe-primary);
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.mla-atlas-hero-grid {
	display: grid;
	grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
	gap: 20px;
	margin-top: 20px;
	align-items: start;
}

.mla-atlas-hero-grid.is-single-col {
	grid-template-columns: 1fr;
}

.mla-atlas-hero-image {
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid var(--mla-fe-border);
	max-width: 200px;
}

.mla-atlas-hero-image img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
	max-height: 150px;
}

.mla-atlas-hero-grid.is-single-col .mla-atlas-hero-image {
	max-width: 240px;
}

.mla-atlas-hero-summary {
	padding: 18px;
	background: #fff;
	border: 1px solid var(--mla-fe-border);
	border-radius: 12px;
}

.mla-atlas-desc-wrap,
.mla-atlas-summary-wrap {
	display: grid;
	gap: 8px;
}

.mla-atlas-desc-text {
	margin: 0;
	line-height: 1.85;
	color: #334155;
}

.mla-atlas-desc-text.mla-atlas-rich-text > :first-child {
	margin-top: 0;
}

.mla-atlas-desc-text.mla-atlas-rich-text > :last-child {
	margin-bottom: 0;
}

.mla-atlas-summary-text {
	margin: 0;
	line-height: 1.8;
	color: #334155;
	white-space: pre-line;
}

.mla-atlas-summary-text.mla-atlas-rich-text {
	white-space: normal;
}

.mla-atlas-desc-text--collapsible:not(.is-expanded),
.mla-atlas-summary-text--collapsible:not(.is-expanded) {
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.mla-atlas-desc-wrap--lines-2 .mla-atlas-desc-text--collapsible:not(.is-expanded) {
	-webkit-line-clamp: 2;
}

button.mla-atlas-desc-more,
button.mla-atlas-summary-more,
.mla-atlas-desc-more,
.mla-atlas-summary-more {
	justify-self: start;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 32px;
	padding: 0 18px;
	border: none;
	border-radius: 9999px;
	background: #16a34a;
	background-clip: padding-box;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
	box-shadow: 0 2px 8px rgba(22, 163, 74, 0.22);
	-webkit-appearance: none;
	appearance: none;
	outline: none;
	box-sizing: border-box;
}

button.mla-atlas-desc-more:hover,
button.mla-atlas-desc-more:focus-visible,
button.mla-atlas-summary-more:hover,
button.mla-atlas-summary-more:focus-visible,
.mla-atlas-desc-more:hover,
.mla-atlas-desc-more:focus-visible,
.mla-atlas-summary-more:hover,
.mla-atlas-summary-more:focus-visible {
	background: #22c55e;
	color: #fff;
	border: none;
	box-shadow: 0 3px 12px rgba(34, 197, 94, 0.28);
}

button.mla-atlas-desc-more:active,
button.mla-atlas-summary-more:active,
.mla-atlas-desc-more:active,
.mla-atlas-summary-more:active {
	background: #15803d;
}

.mla-atlas-section-heading {
	margin: 0 0 12px;
	font-size: 18px;
	font-weight: 700;
	color: var(--mla-fe-text);
}

/* Content layout + TOC */
.mla-atlas-content-layout {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.mla-atlas-sidebar-inner {
	position: sticky;
	top: 24px;
	padding: 18px;
	background: #fff;
	border: 1px solid var(--mla-fe-border);
	border-radius: 12px;
	box-shadow: 0 4px 16px rgba(15, 45, 55, 0.05);
	max-height: calc(100vh - 48px);
	overflow: auto;
}

.mla-atlas-sidebar-title {
	margin: 0 0 12px;
	font-size: 15px;
	font-weight: 700;
}

.mla-atlas-toc-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 2px;
}

.mla-atlas-toc-children {
	list-style: none;
	margin: 2px 0 0;
	padding: 0 4px 0 0;
	display: grid;
	gap: 2px;
}

.mla-atlas-toc-children[hidden] {
	display: none !important;
}

.mla-atlas-toc-row {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

.mla-atlas-toc-nav .mla-atlas-toc-toggle {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	min-width: 22px;
	min-height: 22px;
	max-width: 22px;
	max-height: 22px;
	margin: 0;
	padding: 0 !important;
	border: none !important;
	outline: none;
	box-shadow: none !important;
	border-radius: 50% !important;
	background: var(--mla-toc-toggle-green) !important;
	color: #fff !important;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: center;
	box-sizing: border-box;
	line-height: 1;
	font-family: inherit;
	font-size: 0;
	-webkit-appearance: none;
	appearance: none;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.mla-atlas-toc-nav .mla-atlas-toc-toggle:hover,
.mla-atlas-toc-nav .mla-atlas-toc-toggle:focus-visible {
	border: none !important;
	box-shadow: none !important;
	outline: none;
	background: var(--mla-toc-toggle-green-hover) !important;
}

.mla-atlas-toc-nav .mla-atlas-toc-toggle-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 14px;
	margin: 0;
	padding: 0;
	border: none;
	font-size: 14px;
	line-height: 1;
	transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.mla-atlas-toc-nav .mla-atlas-toc-toggle-icon::before {
	width: 14px;
	height: 14px;
	font-size: 14px;
	line-height: 14px;
	color: #fff !important;
}

.mla-atlas-toc-item.is-expanded > .mla-atlas-toc-row > .mla-atlas-toc-toggle {
	background: var(--mla-toc-toggle-red) !important;
}

.mla-atlas-toc-item.is-expanded > .mla-atlas-toc-row > .mla-atlas-toc-toggle:hover,
.mla-atlas-toc-item.is-expanded > .mla-atlas-toc-row > .mla-atlas-toc-toggle:focus-visible {
	background: var(--mla-toc-toggle-red-hover) !important;
}

/* فصل‌ها و زیرفصل‌ها — سبز/قرمز روشن‌تر از بخش‌ها */
.mla-atlas-toc-nav .mla-atlas-toc-item:not(.mla-atlas-toc-depth-0) > .mla-atlas-toc-row > .mla-atlas-toc-toggle {
	background: var(--mla-toc-toggle-chapter-green) !important;
}

.mla-atlas-toc-nav .mla-atlas-toc-item:not(.mla-atlas-toc-depth-0) > .mla-atlas-toc-row > .mla-atlas-toc-toggle:hover,
.mla-atlas-toc-nav .mla-atlas-toc-item:not(.mla-atlas-toc-depth-0) > .mla-atlas-toc-row > .mla-atlas-toc-toggle:focus-visible {
	background: var(--mla-toc-toggle-chapter-green-hover) !important;
}

.mla-atlas-toc-nav .mla-atlas-toc-item:not(.mla-atlas-toc-depth-0).is-expanded > .mla-atlas-toc-row > .mla-atlas-toc-toggle {
	background: var(--mla-toc-toggle-chapter-red) !important;
}

.mla-atlas-toc-nav .mla-atlas-toc-item:not(.mla-atlas-toc-depth-0).is-expanded > .mla-atlas-toc-row > .mla-atlas-toc-toggle:hover,
.mla-atlas-toc-nav .mla-atlas-toc-item:not(.mla-atlas-toc-depth-0).is-expanded > .mla-atlas-toc-row > .mla-atlas-toc-toggle:focus-visible {
	background: var(--mla-toc-toggle-chapter-red-hover) !important;
}

.mla-atlas-toc-item.is-expanded > .mla-atlas-toc-row > .mla-atlas-toc-toggle .mla-atlas-toc-toggle-icon {
	transform: rotate(180deg);
}

.mla-atlas-toc-link,
.mla-atlas-toc-label {
	flex: 1;
	min-width: 0;
}

.mla-atlas-toc-link {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 9px 12px;
	border-radius: 10px;
	text-decoration: none;
	color: #475569;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.45;
	background: transparent;
	transition: background-color 0.2s ease, color 0.2s ease, font-weight 0.2s ease;
}

.mla-atlas-toc-label {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 9px 12px;
	border-radius: 10px;
	color: #64748b;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.45;
}

.mla-atlas-toc-link:hover {
	background: var(--mla-fe-primary-soft);
	color: var(--mla-fe-primary-dark);
	font-weight: 600;
}

.mla-atlas-toc-link:focus-visible {
	outline: 2px solid rgba(13, 124, 140, 0.35);
	outline-offset: 1px;
}

.mla-atlas-toc-link.is-active,
.mla-atlas-toc-item.is-active > .mla-atlas-toc-row > .mla-atlas-toc-link {
	background: var(--mla-fe-primary-soft);
	color: var(--mla-fe-primary-dark);
	font-weight: 700;
}

.mla-atlas-toc-num {
	flex-shrink: 0;
	unicode-bidi: isolate;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	font-size: 12px;
	color: inherit;
	opacity: 0.85;
}

.mla-atlas-toc-link.is-active .mla-atlas-toc-num,
.mla-atlas-toc-item.is-active > .mla-atlas-toc-row > .mla-atlas-toc-link .mla-atlas-toc-num {
	opacity: 1;
}

.mla-atlas-toc-item.is-active > .mla-atlas-toc-row > .mla-atlas-toc-link {
	font-weight: 700;
}

.mla-atlas-toc-item:has(> .mla-atlas-toc-row > .mla-atlas-toc-link):hover > .mla-atlas-toc-row > .mla-atlas-toc-link:not(.is-active) {
	background: var(--mla-fe-primary-soft);
	color: var(--mla-fe-primary-dark);
	font-weight: 600;
}

.mla-atlas-section-badge,
.mla-atlas-chapter-badge {
	unicode-bidi: isolate;
	font-variant-numeric: tabular-nums;
}

.mla-atlas-section-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding-top: 20px;
	border-top: 1px solid var(--mla-fe-border);
}

.mla-atlas-section-nav__link {
	display: inline-flex;
	align-items: center;
	padding: 10px 20px;
	border-radius: 8px;
	background: var(--mla-fe-primary-soft);
	color: var(--mla-fe-primary-dark);
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	transition: background 0.2s ease, color 0.2s ease;
}

.mla-atlas-section-nav__link:hover,
.mla-atlas-section-nav__link:focus {
	background: var(--mla-fe-primary);
	color: #fff;
}

.mla-atlas-section-nav__placeholder {
	flex: 0 0 100px;
}

.mla-atlas-toc-depth-1 .mla-atlas-toc-link,
.mla-atlas-toc-depth-1 .mla-atlas-toc-label { padding-right: 10px; font-size: 12.5px; }
.mla-atlas-toc-depth-2 .mla-atlas-toc-link,
.mla-atlas-toc-depth-2 .mla-atlas-toc-label { padding-right: 8px; font-size: 12.5px; }
.mla-atlas-toc-depth-3 .mla-atlas-toc-link,
.mla-atlas-toc-depth-3 .mla-atlas-toc-label { padding-right: 6px; font-size: 12px; }

.mla-atlas-toc-empty {
	margin: 0;
	font-size: 13px;
	color: var(--mla-fe-muted);
}

/* Sections tree */
.mla-atlas-body {
	background: #fff;
	border: 1px solid var(--mla-fe-border);
	border-radius: var(--mla-fe-radius);
	padding: 24px;
	box-shadow: var(--mla-fe-shadow);
	transition: opacity 0.2s ease;
}

.mla-atlas-body.is-loading {
	opacity: 0.55;
	pointer-events: none;
}

.mla-atlas-section-nav-wrap {
	margin-top: 28px;
}

.mla-atlas-sections {
	display: grid;
	gap: 28px;
}

.mla-atlas-section-block {
	padding-bottom: 24px;
	border-bottom: 1px solid var(--mla-fe-border);
	scroll-margin-top: 24px;
}

.mla-atlas-section-block:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.mla-atlas-section-block-head,
.mla-atlas-chapter-block-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
}

.mla-atlas-section-badge,
.mla-atlas-chapter-badge {
	display: inline-flex;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	background: var(--mla-fe-primary-soft);
	color: var(--mla-fe-primary-dark);
}

.mla-atlas-section-title {
	margin: 0;
	font-size: 1.45rem;
	font-weight: 800;
	color: var(--mla-fe-text);
}

.mla-atlas-chapter-title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--mla-fe-text);
}

.mla-atlas-section-desc-wrap,
.mla-atlas-chapter-desc-wrap {
	margin-bottom: 0;
}

.mla-atlas-child-index {
	margin: 18px 0 22px;
	padding: 16px 18px;
	background: #f8fbfc;
	border: 1px solid var(--mla-fe-border);
	border-radius: 12px;
}

.mla-atlas-child-index-title {
	margin: 0 0 12px;
	font-size: 14px;
	font-weight: 800;
	color: var(--mla-fe-text);
}

.mla-atlas-child-index-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.mla-atlas-child-index-item {
	margin: 0;
}

.mla-atlas-child-index-link {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: 10px 12px;
	border-radius: 8px;
	background: #fff;
	border: 1px solid var(--mla-fe-border);
	color: var(--mla-fe-primary-dark);
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.5;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mla-atlas-child-index-link:hover,
.mla-atlas-child-index-link:focus {
	background: var(--mla-fe-primary-soft);
	border-color: var(--mla-fe-primary);
	color: var(--mla-fe-primary-dark);
}

.mla-atlas-child-index-num {
	flex-shrink: 0;
	font-size: 12px;
	font-weight: 700;
	color: var(--mla-fe-muted);
}

.mla-atlas-child-index-label {
	flex: 1;
	min-width: 0;
}

.mla-atlas-section-thumb,
.mla-atlas-chapter-thumb {
	margin-bottom: 16px;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid var(--mla-fe-border);
	max-width: 280px;
}

.mla-atlas-section-thumb img,
.mla-atlas-chapter-thumb img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 180px;
	object-fit: cover;
}

.mla-atlas-rich-text {
	line-height: 1.85;
	color: #334155;
}

.mla-atlas-rich-text > * + * {
	margin-top: 0.85em;
}

.mla-atlas-rich-text h2,
.mla-atlas-rich-text h3,
.mla-atlas-rich-text h4 {
	margin: 1.15em 0 0.45em;
	line-height: 1.45;
	font-weight: 700;
	color: var(--mla-fe-text, #0f2d37);
}

.mla-atlas-rich-text h2 {
	font-size: 1.2rem;
}

.mla-atlas-rich-text h3 {
	font-size: 1.08rem;
}

.mla-atlas-rich-text h4 {
	font-size: 1rem;
}

.mla-atlas-rich-text ul,
.mla-atlas-rich-text ol {
	margin: 0.5em 0;
	padding-right: 1.35em;
	padding-left: 0;
}

.mla-atlas-rich-text li + li {
	margin-top: 0.35em;
}

.mla-atlas-rich-text p:last-child {
	margin-bottom: 0;
}

.mla-atlas-rich-text p + p,
.mla-atlas-lightbox-desc p + p {
	margin-top: 0.85em;
}

.mla-atlas-chapters-tree {
	display: grid;
	gap: 18px;
	margin-top: 18px;
}

.mla-atlas-chapter-block {
	padding: 16px;
	background: #f8fbfc;
	border: 1px solid var(--mla-fe-border);
	border-radius: 12px;
	scroll-margin-top: 24px;
}

.mla-atlas-chapter-children {
	display: grid;
	gap: 14px;
	margin-top: 14px;
	padding-right: 14px;
	border-right: 2px solid #c5dde3;
}

.mla-atlas-empty-content {
	margin: 0;
	padding: 20px;
	text-align: center;
	color: var(--mla-fe-muted);
	background: #f8fafc;
	border-radius: 10px;
}

/* Media grid */
.mla-atlas-media-block {
	margin-top: 20px;
}

.mla-atlas-media-block-title {
	margin: 0 0 14px;
	padding-top: 18px;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--mla-fe-text);
	border-top: 1px solid var(--mla-fe-border);
}

.mla-atlas-chapter-block .mla-atlas-media-block-title {
	font-size: 1rem;
}

.mla-atlas-media-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
}

.mla-atlas-media-group {
	margin-top: 18px;
	padding: 16px 16px 18px;
	background: #f8fbfc;
	border: 1px solid var(--mla-fe-border);
	border-radius: 14px;
}

.mla-atlas-media-group:first-of-type {
	margin-top: 4px;
}

.mla-atlas-media-group-title {
	margin: 0 0 14px;
	padding: 0 0 10px;
	font-size: 0.98rem;
	font-weight: 800;
	line-height: 1.45;
	color: var(--mla-fe-primary-dark, #0f5c56);
	border-bottom: 2px solid var(--mla-fe-primary, #0d9488);
}

.mla-atlas-media-block.has-media-groups .mla-atlas-media-block-title {
	margin-bottom: 8px;
}

.mla-atlas-media-card {
	margin: 0;
	background: #fff;
	border: 1px solid var(--mla-fe-border);
	border-radius: 12px;
	overflow: visible;
	box-shadow: 0 2px 8px rgba(15, 45, 55, 0.04);
}

.mla-atlas-media-visual {
	position: relative;
	overflow: visible;
	border-radius: 12px 12px 0 0;
}

.mla-atlas-lightbox-trigger {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 12px 12px 0 0;
}

.mla-atlas-lightbox-trigger img {
	display: block;
	width: 100%;
	height: 180px;
	object-fit: cover;
	transition: transform 0.2s ease;
}

.mla-atlas-lightbox-trigger:hover img {
	transform: scale(1.03);
}

.mla-atlas-media-zoom {
	position: absolute;
	top: 10px;
	right: 10px;
	left: auto;
	bottom: auto;
	width: 32px;
	height: 32px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--mla-fe-primary-dark);
	z-index: 2;
	pointer-events: none;
}

.mla-atlas-media-variants,
.mla-atlas-lightbox-variants {
	display: inline-flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 2px;
	padding: 3px;
	max-width: 100%;
	overflow-x: auto;
	scrollbar-width: none;
	background: rgba(236, 239, 244, 0.92);
	border: 1.5px solid rgba(255, 255, 255, 0.95);
	border-radius: 999px;
	box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

.mla-atlas-media-variants::-webkit-scrollbar,
.mla-atlas-lightbox-variants::-webkit-scrollbar {
	display: none;
}

.mla-atlas-media-variants {
	position: absolute;
	z-index: 4;
	left: 50%;
	/* Sit on the image edge and protrude into the caption area */
	bottom: 0;
	transform: translate(-50%, 50%);
	max-width: calc(100% - 20px);
}

.mla-atlas-lightbox-variants {
	margin: 0 0 14px;
	width: fit-content;
	max-width: 100%;
}

.mla-atlas-lightbox-variants.hidden {
	display: none;
}

.mla-atlas-media-variant,
.mla-atlas-lightbox-variant {
	appearance: none;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 0;
	border: 1.5px solid transparent;
	background: transparent;
	color: #1e293b;
	border-radius: 999px;
	padding: 7px 14px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: 0;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.mla-atlas-media-variant:hover:not(.is-active),
.mla-atlas-lightbox-variant:hover:not(.is-active) {
	background: rgba(255, 255, 255, 0.55);
	color: #0f172a;
}

.mla-atlas-media-variant:focus-visible,
.mla-atlas-lightbox-variant:focus-visible {
	outline: 2px solid #1e2a44;
	outline-offset: 1px;
}

.mla-atlas-media-variant.is-active,
.mla-atlas-lightbox-variant.is-active {
	background: #1e2a44;
	border-color: #fff;
	color: #fff;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}

.mla-atlas-media-variant-label {
	display: inline-block;
}

.mla-atlas-media-caption {
	padding: 28px 14px 14px;
	display: grid;
	gap: 6px;
}

.mla-atlas-media-visual:has(.mla-atlas-media-variants) + .mla-atlas-media-caption {
	padding-top: 28px;
}

.mla-atlas-media-visual:not(:has(.mla-atlas-media-variants)) + .mla-atlas-media-caption {
	padding-top: 12px;
}

.mla-atlas-media-caption .mla-atlas-desc-wrap {
	gap: 6px;
}

.mla-atlas-media-title {
	display: block;
	font-size: 14px;
}

.mla-atlas-media-desc {
	margin: 0;
	font-size: 13px;
	color: var(--mla-fe-muted);
	line-height: 1.6;
}

.mla-atlas-media-ref {
	display: block;
	font-size: 12px;
	color: var(--mla-fe-primary-dark);
	font-style: normal;
}

/* Footer bar */
.mla-atlas-footer-bar {
	margin-top: 28px;
	padding: 18px 20px;
	background: #fff;
	border: 1px solid var(--mla-fe-border);
	border-radius: 12px;
	display: grid;
	gap: 14px;
}

.mla-atlas-keywords {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.mla-atlas-keywords-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	color: var(--mla-fe-text);
}

.mla-atlas-keyword-pill {
	display: inline-flex;
	padding: 4px 10px;
	border-radius: 999px;
	background: #eef3f6;
	color: #475569;
	font-size: 12px;
}

.mla-atlas-footer-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.mla-atlas-print-btn {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
}

.mla-atlas-share-box {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.mla-atlas-share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border-radius: 999px;
	border: 1px solid var(--mla-fe-border);
	background: #fff;
	color: var(--mla-fe-text);
	text-decoration: none;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
}

.mla-atlas-share-btn.is-whatsapp { background: #dcfce7; border-color: #86efac; color: #166534; }
.mla-atlas-share-btn.is-telegram { background: #e0f2fe; border-color: #7dd3fc; color: #075985; }
.mla-atlas-share-btn.is-copy,
.mla-atlas-copy-link {
	padding: 0;
	min-width: 36px;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: #16a34a;
	color: #fff;
	box-shadow: 0 2px 8px rgba(22, 163, 74, 0.22);
	transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
	-webkit-appearance: none;
	appearance: none;
	outline: none;
}

.mla-atlas-share-btn.is-copy .dashicons,
.mla-atlas-copy-link .dashicons {
	width: 18px;
	height: 18px;
	font-size: 18px;
	color: #fff;
}

.mla-atlas-share-btn.is-copy:hover,
.mla-atlas-share-btn.is-copy:focus-visible,
.mla-atlas-copy-link:hover,
.mla-atlas-copy-link:focus-visible {
	background: #22c55e;
	color: #fff;
	border-color: transparent;
	box-shadow: 0 3px 12px rgba(34, 197, 94, 0.28);
}

.mla-atlas-share-btn.is-copy:active,
.mla-atlas-copy-link:active {
	background: #15803d;
}

/* Sources */
.mla-atlas-sources-block {
	margin-top: 28px;
	padding: 20px 22px;
	background: #fff;
	border: 1px solid var(--mla-fe-border);
	border-radius: 12px;
}

.mla-atlas-sources-list {
	margin: 0;
	padding-right: 20px;
	display: grid;
	gap: 8px;
}

.mla-atlas-source-line {
	line-height: 1.7;
	color: #334155;
}

/* Cards */
.mla-atlas-cards-section,
.mla-atlas-archive-wrap {
	margin-top: 36px;
}

.mla-atlas-cards-title,
.mla-atlas-archive-title {
	margin: 0 0 18px;
	font-size: 1.5rem;
	font-weight: 800;
}

.mla-atlas-cards-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.mla-atlas-cards-grid--archive {
	margin-top: 8px;
}

.mla-atlas-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
	background: #fff;
	border: 1px solid var(--mla-fe-border);
	border-radius: 12px;
	overflow: hidden;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mla-atlas-card__link:hover {
	transform: translateY(-2px);
	box-shadow: var(--mla-fe-shadow);
}

.mla-atlas-card__thumb {
	aspect-ratio: 16 / 10;
	background: #f1f5f9;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.mla-atlas-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mla-atlas-card__placeholder .dashicons {
	width: 42px;
	height: 42px;
	font-size: 42px;
	color: #94a3b8;
}

.mla-atlas-card__body {
	padding: 14px 16px 16px;
	display: grid;
	gap: 8px;
}

.mla-atlas-card__level {
	font-size: 11px;
	font-weight: 700;
	color: var(--mla-fe-primary-dark);
}

.mla-atlas-card__title {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	font-weight: 700;
	color: var(--mla-fe-text);
}

.mla-atlas-card__excerpt {
	margin: 0;
	font-size: 13px;
	color: var(--mla-fe-muted);
	line-height: 1.6;
}

.mla-atlas-archive-header {
	margin-bottom: 24px;
}

.mla-atlas-archive-desc {
	margin: 8px 0 0;
	color: var(--mla-fe-muted);
}

.mla-atlas-pagination {
	margin-top: 24px;
}

.mla-atlas-archive-empty {
	padding: 24px;
	text-align: center;
	background: #f8fafc;
	border-radius: 12px;
}

/* Lightbox viewer */
.mla-atlas-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.mla-atlas-lightbox.hidden {
	display: none;
}

body.mla-atlas-lightbox-open {
	overflow: hidden;
}

.mla-atlas-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.88);
}

.mla-atlas-lightbox-close {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #e53935;
	font-size: 26px;
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.35);
	transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
	-webkit-appearance: none;
	appearance: none;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}

.mla-atlas-lightbox-close:hover,
.mla-atlas-lightbox-close:focus-visible {
	background: #e53935;
	color: #fff;
	box-shadow: 0 6px 20px rgba(229, 57, 53, 0.38);
}

.mla-atlas-lightbox-close:active {
	transform: scale(0.94);
}

#mla-atlas-lightbox .mla-atlas-lightbox-close:hover,
#mla-atlas-lightbox .mla-atlas-lightbox-close:focus,
#mla-atlas-lightbox .mla-atlas-lightbox-close:active {
	border: 0;
	outline: none;
}

.mla-atlas-lightbox-shell {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: row;
	width: min(1180px, 96vw);
	height: min(88vh, 860px);
	background: #fff;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

@media (min-width: 821px) {
	.mla-atlas-lightbox-shell {
		width: min(98vw, calc(70vw + clamp(260px, 28vw, 380px)));
		max-width: none;
		height: min(92vh, 940px);
	}

	.mla-atlas-lightbox-viewport {
		flex: 0 0 70vw;
		width: 70vw;
		max-width: 70vw;
	}

	.mla-atlas-lightbox-sidebar {
		flex: 1 1 0;
		max-width: none;
		min-width: 260px;
		width: auto;
	}

	.mla-atlas-lightbox-stage {
		min-height: calc(70vh - 96px);
	}

	.mla-atlas-lightbox-image {
		max-width: calc(70vw - 48px);
		max-height: calc(70vh - 128px);
	}
}

.mla-atlas-lightbox-sidebar {
	flex: 0 0 30%;
	max-width: 30%;
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 22px 20px;
	background: #f8fbfc;
	border-left: 1px solid var(--mla-fe-border);
	overflow: hidden;
	min-height: 0;
}

.mla-atlas-lightbox-tabs {
	display: none;
	flex-shrink: 0;
	gap: 8px;
	margin-bottom: 12px;
	padding: 4px;
	background: #e8f0f3;
	border-radius: 10px;
}

.mla-atlas-lightbox-tab {
	flex: 1;
	margin: 0;
	padding: 10px 12px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #475569;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.mla-atlas-lightbox-tab:hover,
.mla-atlas-lightbox-tab:focus-visible {
	background: rgba(255, 255, 255, 0.65);
	color: var(--mla-fe-text);
	outline: none;
}

.mla-atlas-lightbox-tab.is-active {
	background: #fff;
	color: var(--mla-fe-text);
	box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.mla-atlas-lightbox-tabpanels {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	gap: 14px;
}

.mla-atlas-lightbox-tabpanel {
	min-height: 0;
}

.mla-atlas-lightbox-tabpanel[data-tabpanel="info"] {
	flex: 1;
	min-height: 0;
	overflow: hidden;
}

.mla-atlas-lightbox-tabpanel[data-tabpanel="adjust"] {
	flex-shrink: 0;
	margin-top: auto;
}

@media (min-width: 821px) {
	.mla-atlas-lightbox-tabpanel[data-tabpanel="info"] {
		display: flex;
		flex-direction: column;
	}

	.mla-atlas-lightbox-tabpanel[data-tabpanel="info"],
	.mla-atlas-lightbox-tabpanel[data-tabpanel="adjust"] {
		display: flex;
		flex-direction: column;
	}

	.mla-atlas-lightbox-tabpanel[hidden] {
		display: flex !important;
	}
}

.mla-atlas-lightbox-title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 800;
	line-height: 1.5;
	color: var(--mla-fe-text);
}

.mla-atlas-lightbox-desc {
	flex: 1;
	font-size: 14px;
	line-height: 1.85;
	color: #334155;
	overflow: auto;
}

.mla-atlas-lightbox-desc > :first-child {
	margin-top: 0;
}

.mla-atlas-lightbox-desc > :last-child {
	margin-bottom: 0;
}

.mla-atlas-lightbox-adjust {
	flex-shrink: 0;
	margin-top: auto;
	padding-top: 14px;
	border-top: 1px solid var(--mla-fe-border);
}

.mla-atlas-lightbox-adjust-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 10px;
}

.mla-atlas-lightbox-adjust-title {
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	color: var(--mla-fe-text);
}

.mla-atlas-lightbox-adjust-reset {
	border: 1px solid var(--mla-fe-border);
	background: #fff;
	color: #475569;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.mla-atlas-lightbox-adjust-reset:hover,
.mla-atlas-lightbox-adjust-reset:focus-visible {
	background: #eef6f8;
	border-color: #94a3b8;
	color: #0f172a;
	outline: none;
}

.mla-atlas-lightbox-adjust-row {
	display: grid;
	grid-template-columns: 52px 1fr 36px;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
	cursor: default;
}

.mla-atlas-lightbox-adjust-row:last-child {
	margin-bottom: 0;
}

.mla-atlas-lightbox-adjust-label {
	font-size: 12px;
	font-weight: 600;
	color: #475569;
}

.mla-atlas-lightbox-adjust-value {
	font-size: 12px;
	font-weight: 700;
	color: #0f766e;
	text-align: center;
	direction: ltr;
}

.mla-atlas-lightbox-adjust-slider {
	width: 100%;
	height: 6px;
	margin: 0;
	accent-color: #0d9488;
	cursor: pointer;
}

.mla-atlas-lightbox-adjust-row--toggle {
	grid-template-columns: 1fr auto;
	margin-top: 4px;
	padding-top: 8px;
	border-top: 1px dashed #e2e8f0;
}

.mla-atlas-lightbox-adjust-phase {
	border: 1px solid #cbd5e1;
	background: #fff;
	color: #475569;
	font-size: 12px;
	font-weight: 700;
	padding: 6px 14px;
	border-radius: 999px;
	cursor: pointer;
	min-width: 72px;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.mla-atlas-lightbox-adjust-phase:hover,
.mla-atlas-lightbox-adjust-phase:focus-visible {
	border-color: #0d9488;
	color: #0f766e;
	outline: none;
}

.mla-atlas-lightbox-adjust-phase.is-active {
	background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
	border-color: #0f766e;
	color: #fff;
	box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
}

.mla-atlas-lightbox-viewport {
	position: relative;
	flex: 0 0 70%;
	max-width: 70%;
	display: flex;
	flex-direction: column;
	background: #0f172a;
	min-width: 0;
}

.mla-atlas-lightbox-nav {
	position: absolute;
	top: 50%;
	z-index: 4;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.72);
	color: #fff;
	cursor: pointer;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
	transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.mla-atlas-lightbox-nav.hidden {
	display: none;
}

.mla-atlas-lightbox-nav .dashicons {
	width: 28px;
	height: 28px;
	font-size: 28px;
}

.mla-atlas-lightbox-nav--prev {
	inset-inline-start: 14px;
}

.mla-atlas-lightbox-nav--next {
	inset-inline-end: 14px;
}

.mla-atlas-lightbox-nav:hover,
.mla-atlas-lightbox-nav:focus-visible {
	background: rgba(30, 41, 59, 0.92);
	transform: translateY(-50%) scale(1.04);
}

.mla-atlas-lightbox-nav:active {
	transform: translateY(-50%) scale(0.98);
}

.mla-atlas-lightbox-counter {
	position: absolute;
	top: 14px;
	inset-inline-end: 14px;
	z-index: 4;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.72);
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: #e2e8f0;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.mla-atlas-lightbox-counter.hidden {
	display: none;
}

.mla-atlas-lightbox-focus {
	position: absolute;
	top: 14px;
	inset-inline-start: 14px;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: calc(100% - 120px);
	padding: 7px 12px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.72);
	color: #e2e8f0;
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
	transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.mla-atlas-lightbox-focus .dashicons {
	width: 18px;
	height: 18px;
	font-size: 18px;
	flex-shrink: 0;
}

.mla-atlas-lightbox-focus:hover,
.mla-atlas-lightbox-focus:focus-visible {
	background: rgba(30, 41, 59, 0.92);
	color: #fff;
	outline: none;
}

.mla-atlas-lightbox-focus.is-active {
	background: rgba(13, 148, 136, 0.88);
	border-color: rgba(255, 255, 255, 0.28);
	color: #fff;
}

.mla-atlas-lightbox-focus:active {
	transform: scale(0.98);
}

.mla-atlas-lightbox.is-image-focus {
	padding: 0;
}

.mla-atlas-lightbox-shell.is-image-focus {
	width: 100vw;
	height: 100vh;
	max-width: 100vw;
	max-height: 100vh;
	border-radius: 0;
}

.mla-atlas-lightbox-shell.is-image-focus .mla-atlas-lightbox-sidebar {
	display: none !important;
}

.mla-atlas-lightbox-shell.is-image-focus .mla-atlas-lightbox-viewport {
	flex: 1 1 auto;
	width: 100%;
	max-width: 100%;
	order: 0;
}

.mla-atlas-lightbox-shell.is-image-focus .mla-atlas-lightbox-stage {
	min-height: 0;
	padding: 16px 16px 88px;
}

.mla-atlas-lightbox-shell.is-image-focus .mla-atlas-lightbox-image {
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 112px);
}

.mla-atlas-lightbox-ref {
	display: block;
	margin-top: 12px;
	font-style: normal;
	font-size: 12px;
	color: #94a3b8;
}

.mla-atlas-lightbox-stage {
	position: relative;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 20px 20px 88px;
}

.mla-atlas-lightbox-stage.is-zoomed {
	cursor: grab;
}

.mla-atlas-lightbox-stage.is-dragging {
	cursor: grabbing;
}

.mla-atlas-lightbox-image {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	transform-origin: center center;
	transition: transform 0.12s ease-out, filter 0.12s ease-out;
	user-select: none;
	-webkit-user-drag: none;
	content-visibility: auto;
}

.mla-atlas-lightbox-image.is-resolving,
.mla-atlas-lightbox-image.is-loading-full {
	transition: none;
}

.mla-atlas-lightbox-stage.is-image-loading .mla-atlas-lightbox-image.is-loading-full {
	opacity: 0.96;
}

.mla-atlas-lightbox-stage.is-dragging .mla-atlas-lightbox-image {
	transition: none;
}

.mla-atlas-lightbox-controls {
	--mla-lb-control-bg: rgba(88, 88, 94, 0.6);
	--mla-lb-scale: 0.7;
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 14px;
	z-index: 2;
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: end;
	direction: ltr;
	gap: 10px;
	width: auto;
	transform: none;
}

.mla-atlas-lightbox-pan.is-disabled {
	opacity: 0.38;
	pointer-events: none;
}

.mla-atlas-lightbox-zoombar {
	grid-column: 2;
	justify-self: end;
	display: flex;
	align-items: center;
	gap: calc(12px * var(--mla-lb-scale));
	width: min(252px, 100%);
	flex: 0 1 auto;
	padding: calc(10px * var(--mla-lb-scale)) calc(14px * var(--mla-lb-scale));
	border-radius: 999px;
	background: var(--mla-lb-control-bg);
	border: 1px solid rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

#mla-atlas-lightbox .mla-atlas-lightbox-zoom-btn,
#mla-atlas-lightbox .mla-atlas-lightbox-pan-btn {
	-webkit-appearance: none;
	appearance: none;
	outline: none;
	box-shadow: none;
	border-color: transparent;
}

#mla-atlas-lightbox .mla-atlas-lightbox-zoom-btn:hover,
#mla-atlas-lightbox .mla-atlas-lightbox-zoom-btn:focus,
#mla-atlas-lightbox .mla-atlas-lightbox-zoom-btn:active,
#mla-atlas-lightbox .mla-atlas-lightbox-pan-btn:hover,
#mla-atlas-lightbox .mla-atlas-lightbox-pan-btn:focus,
#mla-atlas-lightbox .mla-atlas-lightbox-pan-btn:active {
	background: transparent;
	border-color: transparent;
	box-shadow: none;
	outline: none;
}

.mla-atlas-lightbox-zoom-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: calc(40px * var(--mla-lb-scale));
	height: calc(40px * var(--mla-lb-scale));
	border: 1px solid transparent;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: calc(22px * var(--mla-lb-scale));
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: color 0.18s ease, transform 0.12s ease;
	flex-shrink: 0;
	box-shadow: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.mla-atlas-lightbox-zoom-btn:hover,
.mla-atlas-lightbox-zoom-btn:focus-visible,
.mla-atlas-lightbox-zoom-btn:active,
.mla-atlas-lightbox-zoom-btn.is-active {
	background: transparent;
	border-color: transparent;
	color: #e53935;
	box-shadow: none;
	outline: none;
}

.mla-atlas-lightbox-zoom-btn:active {
	transform: scale(0.94);
}

.mla-atlas-lightbox-zoom-track {
	position: relative;
	flex: 1;
	height: calc(10px * var(--mla-lb-scale));
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.1);
	cursor: pointer;
	min-width: 0;
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
}

.mla-atlas-lightbox-zoom-track:focus {
	outline: 2px solid rgba(255, 255, 255, 0.45);
	outline-offset: 2px;
}

.mla-atlas-lightbox-zoom-fill {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, rgba(13, 124, 140, 0.65), #14b8c4);
	pointer-events: none;
	box-shadow: 0 0 12px rgba(13, 124, 140, 0.35);
}

.mla-atlas-lightbox-zoom-thumb {
	position: absolute;
	top: 50%;
	left: 0;
	width: calc(20px * var(--mla-lb-scale));
	height: calc(20px * var(--mla-lb-scale));
	border: 2px solid #fff;
	border-radius: 50%;
	background: linear-gradient(180deg, #22d3ee 0%, var(--mla-fe-primary) 100%);
	transform: translate(-50%, -50%);
	cursor: grab;
	padding: 0;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(13, 124, 140, 0.25);
}

.mla-atlas-lightbox-zoom-thumb.is-dragging {
	cursor: grabbing;
	transform: translate(-50%, -50%) scale(1.08);
}

.mla-atlas-lightbox-pan-btn .dashicons {
	display: none;
}

/* PS4-style D-pad */
.mla-atlas-lightbox-pan {
	position: relative;
	grid-column: 1;
	justify-self: start;
	width: calc(148px * var(--mla-lb-scale));
	height: calc(148px * var(--mla-lb-scale));
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--mla-lb-control-bg, rgba(88, 88, 94, 0.6));
	border: 1px solid rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.mla-atlas-lightbox-pan-cross {
	position: absolute;
	inset: calc(22px * var(--mla-lb-scale));
	pointer-events: none;
}

.mla-atlas-lightbox-pan-cross::before,
.mla-atlas-lightbox-pan-cross::after {
	content: '';
	position: absolute;
	background: rgba(62, 62, 68, 0.55);
	border-radius: 5px;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mla-atlas-lightbox-pan-cross::before {
	top: 0;
	bottom: 0;
	left: 50%;
	width: calc(38px * var(--mla-lb-scale));
	transform: translateX(-50%);
}

.mla-atlas-lightbox-pan-cross::after {
	left: 0;
	right: 0;
	top: 50%;
	height: calc(38px * var(--mla-lb-scale));
	transform: translateY(-50%);
}

.mla-atlas-lightbox-pan-hub {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	width: calc(34px * var(--mla-lb-scale));
	height: calc(34px * var(--mla-lb-scale));
	border-radius: 50%;
	transform: translate(-50%, -50%);
	background: rgba(48, 48, 54, 0.65);
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
	pointer-events: none;
}

.mla-atlas-lightbox-pan-btn {
	position: absolute;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition: color 0.15s ease, transform 0.1s ease, filter 0.15s ease;
	outline: none;
}

.mla-atlas-lightbox-pan-icon {
	display: block;
	width: 0;
	height: 0;
	border-left: calc(6px * var(--mla-lb-scale)) solid transparent;
	border-right: calc(6px * var(--mla-lb-scale)) solid transparent;
	border-bottom: calc(9px * var(--mla-lb-scale)) solid #fff;
	opacity: 0.95;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
	transition: border-bottom-color 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.mla-atlas-lightbox-pan-btn--up {
	top: calc(10px * var(--mla-lb-scale));
	left: 50%;
	width: calc(54px * var(--mla-lb-scale));
	height: calc(46px * var(--mla-lb-scale));
	transform: translateX(-50%);
}

.mla-atlas-lightbox-pan-btn--up .mla-atlas-lightbox-pan-icon {
	margin-top: -4px;
}

.mla-atlas-lightbox-pan-btn--down {
	bottom: calc(10px * var(--mla-lb-scale));
	left: 50%;
	width: calc(54px * var(--mla-lb-scale));
	height: calc(46px * var(--mla-lb-scale));
	transform: translateX(-50%);
}

.mla-atlas-lightbox-pan-btn--down .mla-atlas-lightbox-pan-icon {
	transform: rotate(180deg);
	margin-bottom: -4px;
}

.mla-atlas-lightbox-pan-btn--left {
	left: calc(10px * var(--mla-lb-scale));
	top: 50%;
	width: calc(46px * var(--mla-lb-scale));
	height: calc(54px * var(--mla-lb-scale));
	transform: translateY(-50%);
}

.mla-atlas-lightbox-pan-btn--left .mla-atlas-lightbox-pan-icon {
	transform: rotate(-90deg);
	margin-left: -4px;
}

.mla-atlas-lightbox-pan-btn--right {
	right: calc(10px * var(--mla-lb-scale));
	top: 50%;
	width: calc(46px * var(--mla-lb-scale));
	height: calc(54px * var(--mla-lb-scale));
	transform: translateY(-50%);
}

.mla-atlas-lightbox-pan-btn--right .mla-atlas-lightbox-pan-icon {
	transform: rotate(90deg);
	margin-right: -4px;
}

.mla-atlas-lightbox-pan-btn:hover,
.mla-atlas-lightbox-pan-btn:focus-visible,
.mla-atlas-lightbox-pan-btn:active,
.mla-atlas-lightbox-pan-btn.is-active {
	background: transparent;
	color: #e53935;
	outline: none;
	border: 0;
	box-shadow: none;
}

.mla-atlas-lightbox-pan-btn:hover .mla-atlas-lightbox-pan-icon,
.mla-atlas-lightbox-pan-btn:focus-visible .mla-atlas-lightbox-pan-icon,
.mla-atlas-lightbox-pan-btn:active .mla-atlas-lightbox-pan-icon,
.mla-atlas-lightbox-pan-btn.is-active .mla-atlas-lightbox-pan-icon {
	border-bottom-color: #e53935;
	opacity: 1;
	filter: drop-shadow(0 0 6px rgba(229, 57, 53, 0.45));
}

.mla-atlas-lightbox-pan-btn--up:active,
.mla-atlas-lightbox-pan-btn--up.is-active {
	transform: translateX(-50%) translateY(2px);
}

.mla-atlas-lightbox-pan-btn--down:active,
.mla-atlas-lightbox-pan-btn--down.is-active {
	transform: translateX(-50%) translateY(-2px);
}

.mla-atlas-lightbox-pan-btn--left:active,
.mla-atlas-lightbox-pan-btn--left.is-active {
	transform: translateY(-50%) translateX(2px);
}

.mla-atlas-lightbox-pan-btn--right:active,
.mla-atlas-lightbox-pan-btn--right.is-active {
	transform: translateY(-50%) translateX(-2px);
}

@media (max-width: 820px) {
	.mla-atlas-lightbox-shell {
		flex-direction: column;
		height: min(94vh, 900px);
		width: min(96vw, 640px);
	}

	.mla-atlas-lightbox-viewport {
		order: 1;
		flex: 1 1 auto;
		max-width: none;
		min-height: 0;
		width: auto;
	}

	.mla-atlas-lightbox-sidebar {
		order: 2;
		flex: 0 0 auto;
		max-width: none;
		max-height: none;
		height: min(42vh, 320px);
		min-height: 200px;
		border-left: 0;
		border-top: 1px solid var(--mla-fe-border);
		padding: 14px 16px 16px;
		overflow: hidden;
	}

	.mla-atlas-lightbox-tabs {
		display: flex;
	}

	.mla-atlas-lightbox-tabpanels {
		display: block;
		flex: 1;
		min-height: 0;
		gap: 0;
	}

	.mla-atlas-lightbox-tabpanel {
		display: none !important;
		flex: none;
		min-height: 0;
		overflow: auto;
		-webkit-overflow-scrolling: touch;
	}

	.mla-atlas-lightbox-tabpanel.is-active {
		display: flex !important;
		flex-direction: column;
		flex: 1;
		min-height: 0;
	}

	.mla-atlas-lightbox-tabpanel[data-tabpanel="info"]:not(.is-active),
	.mla-atlas-lightbox-tabpanel[data-tabpanel="adjust"]:not(.is-active) {
		display: none !important;
	}

	.mla-atlas-lightbox-tabpanel[data-tabpanel="info"] {
		gap: 10px;
	}

	.mla-atlas-lightbox-tabpanel[data-tabpanel="adjust"] {
		margin-top: 0;
	}

	.mla-atlas-lightbox-tabpanel[data-tabpanel="adjust"] .mla-atlas-lightbox-adjust {
		margin-top: 0;
		padding-top: 0;
		border-top: 0;
	}

	.mla-atlas-lightbox-tabpanel[data-tabpanel="adjust"] .mla-atlas-lightbox-adjust-title {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	.mla-atlas-lightbox-tabpanel[data-tabpanel="adjust"] .mla-atlas-lightbox-adjust-head {
		justify-content: flex-end;
		margin-bottom: 4px;
	}

	.mla-atlas-lightbox-desc {
		flex: 1;
	}

	.mla-atlas-lightbox-nav {
		width: 40px;
		height: 40px;
	}

	.mla-atlas-lightbox-nav .dashicons {
		width: 24px;
		height: 24px;
		font-size: 24px;
	}

	.mla-atlas-lightbox-shell.is-image-focus {
		width: 100vw;
		height: 100vh;
		max-height: 100vh;
	}

	.mla-atlas-lightbox-focus-label {
		display: none;
	}

	.mla-atlas-lightbox-focus {
		max-width: none;
		width: 40px;
		height: 40px;
		padding: 0;
		justify-content: center;
	}
}

@media (max-width: 960px) {
	.mla-atlas-content-layout {
		grid-template-columns: 1fr;
	}

	.mla-atlas-sidebar-inner {
		position: static;
		max-height: none;
	}

	.mla-atlas-hero-grid {
		grid-template-columns: 1fr;
	}

	.mla-atlas-hero-image {
		max-width: 100%;
	}

	.mla-atlas-hero-image img {
		max-height: 200px;
	}

	.mla-atlas-cards-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.mla-atlas-cards-grid {
		grid-template-columns: 1fr;
	}

	.mla-atlas-body {
		padding: 16px;
	}
}

@media print {
	.mla-atlas-preview-banner,
	.mla-atlas-sidebar,
	.mla-atlas-footer-bar,
	.mla-atlas-cards-section,
	.mla-atlas-lightbox {
		display: none !important;
	}

	.mla-atlas-content-layout {
		grid-template-columns: 1fr;
	}

	.mla-atlas-wrap {
		max-width: none;
		padding: 0;
	}
}

/* Paywall and access */
.mla-atlas-toc-item.is-locked .mla-atlas-toc-link {
	opacity: 0.85;
}
.mla-atlas-toc-lock {
	font-size: 14px;
	width: 14px;
	height: 14px;
	margin-inline-start: 4px;
	vertical-align: middle;
	color: #64748b;
}
.mla-atlas-toc-free {
	display: inline-block;
	margin-inline-start: 6px;
	padding: 1px 7px;
	border-radius: 999px;
	background: #e8f6f8;
	color: #0a5f6b;
	font-size: 10px;
	font-weight: 700;
}
.mla-atlas-paywall {
	display: flex;
	justify-content: center;
	padding: 28px 12px;
}
.mla-atlas-paywall-card {
	width: min(520px, 100%);
	text-align: center;
	padding: 28px 22px;
	border: 1px solid var(--mla-fe-border);
	border-radius: 16px;
	background: linear-gradient(180deg, #fff, #f8fbfc);
	box-shadow: var(--mla-fe-shadow);
}
.mla-atlas-paywall-icon {
	font-size: 36px;
	width: 36px;
	height: 36px;
	color: var(--mla-fe-primary);
}
.mla-atlas-paywall-title {
	margin: 12px 0 8px;
	font-size: 1.15rem;
}
.mla-atlas-paywall-text {
	margin: 0 0 16px;
	color: var(--mla-fe-muted);
	line-height: 1.7;
}
.mla-atlas-paywall-price {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: baseline;
	justify-content: center;
	margin-bottom: 16px;
}
.mla-atlas-paywall-price-value {
	font-size: 1.25rem;
	color: var(--mla-fe-primary-dark);
}
.mla-atlas-paywall-price-old {
	text-decoration: line-through;
	color: var(--mla-fe-muted);
	font-size: 0.9rem;
}
.mla-atlas-paywall-coupon {
	text-align: right;
	margin: 0 0 14px;
}
.mla-atlas-paywall-coupon-row {
	display: flex;
	gap: 8px;
	margin-top: 6px;
}
.mla-atlas-paywall-coupon-input {
	flex: 1;
	min-width: 0;
}
.mla-atlas-paywall-coupon-msg {
	margin: 8px 0 0;
	color: var(--mla-fe-primary-dark);
	font-size: 13px;
}
.mla-atlas-paywall-payment {
	margin-top: 12px;
}
.mla-atlas-paywall-hint {
	margin-top: 10px;
	font-size: 12px;
	color: var(--mla-fe-muted);
}