/* Encyclopedia pages: chemistry terms + chemical elements */

.ency-page,
.ency-archive {
	direction: rtl;
	text-align: right;
	color: #0f172a;
}

.ency-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: 1.4rem;
	font-size: 0.8rem;
	color: #64748b;
}

.ency-breadcrumb a {
	color: #0284c7;
}

.ency-hero {
	display: grid;
	gap: 1.5rem;
	align-items: center;
	margin-bottom: 2.25rem;
	padding: 1.4rem;
	border-radius: 1.6rem;
	color: #f8fafc;
}

.ency-hero--term {
	grid-template-columns: 1.3fr minmax(180px, 280px);
	background: linear-gradient(135deg, #0f172a 0%, #0e7490 70%, #0f766e 140%);
}

.ency-hero--element {
	grid-template-columns: 140px 1fr;
	background: linear-gradient(135deg, #111827 0%, #1e3a5f 55%, #b45309 160%);
}

.ency-hero__kicker {
	margin: 0 0 0.4rem;
	font-size: 0.78rem;
	color: #7dd3fc;
}

.ency-hero__title {
	margin: 0;
	font-size: clamp(1.7rem, 3vw, 2.5rem);
	font-weight: 900;
	line-height: 1.35;
}

.ency-hero__en {
	margin: 0.3rem 0 0;
	color: #fde68a;
}

.ency-hero__lede {
	margin: 0.9rem 0 0;
	line-height: 1.9;
	color: #e2e8f0;
}

.ency-hero__image {
	width: 100%;
	border-radius: 1.1rem;
	object-fit: cover;
	max-height: 240px;
}

.ency-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

.ency-chips li {
	padding: 0.35rem 0.7rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.14);
	font-size: 0.78rem;
}

.ency-periodic {
	width: 128px;
	height: 148px;
	border-radius: 1rem;
	border: 2px solid #fbbf24;
	background: rgba(15, 23, 42, 0.45);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.15rem;
}

.ency-periodic__number {
	font-size: 0.75rem;
	color: #cbd5e1;
}

.ency-periodic__symbol {
	font-size: 2.4rem;
	font-weight: 900;
	line-height: 1;
	color: #7dd3fc;
}

.ency-periodic__name {
	font-size: 0.7rem;
	color: #fde68a;
}

.ency-body {
	max-width: 52rem;
	margin: 0 auto;
	font-size: 1.05rem;
	line-height: 2;
}

.ency-body .article-featured-figure {
	display: none;
}

.ency-toc {
	position: sticky;
	top: 76px;
	z-index: 5;
	margin: 1.4rem 0 2rem;
	padding: 1rem 1.2rem;
	border: 1px solid #dbeafe;
	border-radius: 1.1rem;
	background: #f8fafc;
}

.ency-toc h2 {
	margin: 0 0 0.55rem;
	font-size: 1rem;
	color: #0f766e;
}

.ency-toc ol {
	margin: 0;
	padding: 0 1.1rem 0 0;
	columns: 2;
}

.ency-toc a {
	color: #0369a1;
	text-decoration: none;
}

.ency-identity-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
	margin: 0;
}

.ency-identity-grid__item {
	margin: 0;
	padding: 0.85rem 1rem;
	border-radius: 1rem;
	background: #f0f9ff;
	border: 1px solid #bae6fd;
}

.ency-identity-grid dt {
	margin: 0 0 0.15rem;
	font-size: 0.75rem;
	color: #0284c7;
}

.ency-identity-grid dd {
	margin: 0;
	font-weight: 700;
}

.ency-chapter {
	margin: 2.3rem 0 1rem;
	padding: 0.95rem 1.15rem;
	border-radius: 1.05rem;
	border-right: 5px solid;
}

.ency-chapter__kicker {
	margin: 0;
	font-size: 0.75rem;
}

.ency-chapter__title {
	margin: 0.15rem 0 0;
	font-size: 1.3rem;
	font-weight: 800;
}

.ency-chapter--understand,
.ency-chapter--identity {
	background: #ecfeff;
	border-color: #0f766e;
	color: #115e59;
}

.ency-chapter--explore,
.ency-chapter--chemistry {
	background: #fffbeb;
	border-color: #d97706;
	color: #92400e;
}

.ency-chapter--exam {
	background: #f5f3ff;
	border-color: #7c3aed;
	color: #5b21b6;
}

.ency-section {
	margin: 0 0 2rem;
	border-right: 3px solid transparent;
	padding-right: 0.35rem;
}

.ency-section--understand,
.ency-section--identity {
	border-color: #99f6e4;
}

.ency-section--explore,
.ency-section--chemistry {
	border-color: #fcd34d;
}

.ency-section--exam {
	border-color: #c4b5fd;
}

.ency-body h2 {
	margin: 0 0 0.8rem;
	font-size: 1.35rem;
	font-weight: 800;
}

.ency-body a {
	color: #0284c7;
}

.ency-fact-cards {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.8rem;
	list-style: none;
	margin: 1rem 0 0;
	padding: 0;
}

.ency-fact-cards li {
	margin: 0;
	padding: 0.9rem 1rem;
	border-radius: 1rem;
	background: #fff7ed;
	border: 1px solid #fdba74;
}

.ency-cta {
	padding: 1.15rem 1.25rem;
	border-radius: 1.2rem;
	background: linear-gradient(135deg, #0ea5e9, #0f766e);
	color: #fff;
}

.ency-cta h2,
.ency-cta p,
.ency-cta li {
	color: #fff;
}

.ency-body .teacher-note {
	margin: 1.2rem 0;
	padding: 1rem 1.15rem;
	border-radius: 1rem;
	background: #0f172a;
	color: #f8fafc;
	border-right: 5px solid #f59e0b;
}

.ency-body .faq-item {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
}

.ency-body .faq-item.is-collapsed > *:not(h3) {
	display: none;
}

.ency-related,
.ency-archive__header {
	margin-top: 2.5rem;
}

.ency-related h2,
.ency-archive__header h1 {
	font-weight: 900;
}

.ency-archive__header {
	margin-top: 0;
	margin-bottom: 1.8rem;
}

.ency-archive__kicker {
	margin: 0;
	color: #0284c7;
	font-weight: 700;
}

.ency-archive__lede {
	max-width: 42rem;
	color: #475569;
}

.ency-related__grid,
.ency-archive__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.ency-related__card,
.ency-card {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 1rem;
	border-radius: 1.1rem;
	background: #fff;
	border: 1px solid #e2e8f0;
	text-decoration: none;
	color: inherit;
}

.ency-related__card--element {
	align-items: flex-start;
}

.ency-related__card--element strong {
	font-size: 1.4rem;
	color: #0284c7;
}

.ency-card h2,
.ency-related__card span {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 800;
	color: #d97706;
}

.ency-card__en,
.ency-related__card small {
	color: #64748b;
	font-size: 0.8rem;
}

.ency-card__excerpt {
	margin: 0.4rem 0 0;
	font-size: 0.85rem;
	color: #475569;
}

.ency-card__cta {
	margin-top: 0.6rem;
	font-size: 0.8rem;
	font-weight: 700;
	color: #0284c7;
}

.ency-periodic-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	gap: 0.75rem;
}

.ency-periodic-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 120px;
	padding: 0.7rem 0.4rem;
	border-radius: 0.9rem;
	background: #fff;
	border: 1px solid #e2e8f0;
	text-decoration: none;
	color: inherit;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ency-periodic-tile:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.ency-periodic-tile__n {
	font-size: 0.7rem;
	color: #64748b;
}

.ency-periodic-tile__s {
	font-size: 1.7rem;
	font-weight: 900;
	color: #0369a1;
	line-height: 1.1;
}

.ency-periodic-tile__f {
	font-size: 0.75rem;
	color: #d97706;
	text-align: center;
}

html.dark .ency-page,
html.dark .ency-archive {
	color: #e2e8f0;
}

html.dark .ency-toc,
html.dark .ency-identity-grid__item,
html.dark .ency-body .faq-item,
html.dark .ency-card,
html.dark .ency-related__card,
html.dark .ency-periodic-tile {
	background: #111827;
	border-color: #334155;
	color: #e2e8f0;
}

html.dark .ency-identity-grid dd,
html.dark .ency-body h2,
html.dark .ency-body p,
html.dark .ency-body li {
	color: #e2e8f0;
}

html.dark .ency-chapter--understand,
html.dark .ency-chapter--identity {
	background: #042f2e;
	color: #99f6e4;
}

html.dark .ency-chapter--explore,
html.dark .ency-chapter--chemistry {
	background: #422006;
	color: #fde68a;
}

html.dark .ency-chapter--exam {
	background: #2e1065;
	color: #ddd6fe;
}

@media (max-width: 900px) {
	.ency-hero--term,
	.ency-hero--element,
	.ency-identity-grid,
	.ency-fact-cards,
	.ency-related__grid,
	.ency-archive__grid,
	.ency-toc ol {
		grid-template-columns: 1fr;
		columns: 1;
	}
}
