/*
Theme Name: ArticleHub Child
Description: Clean academic WordPress theme for ArticleHub local build.
Version: 1.0.0
Author: ArticleHub
*/

:root {
	--ah-theme-ink: #161124;
	--ah-theme-muted: #625b70;
	--ah-theme-line: #e7e3ee;
	--ah-theme-soft: #faf9fc;
	--ah-theme-teal: #5b35b1;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: #ffffff;
	color: var(--ah-theme-ink);
	overflow-x: hidden;
	max-width: 100%;
}

html {
	overflow-x: hidden;
	max-width: 100%;
}

a {
	color: var(--ah-theme-teal);
}

html[dir="rtl"] body {
	direction: rtl;
	text-align: right;
	font-family: Tahoma, "Segoe UI", Arial, sans-serif;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	border-bottom: 1px solid rgba(91, 53, 177, 0.14);
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(12px);
}

.site-header-inner,
.site-footer-inner {
	width: min(1440px, calc(100% - 24px));
	margin: 0 auto;
}

.site-header-inner {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 12px;
	min-height: 66px;
	padding: 8px 0;
}

.site-logo {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	min-width: 0;
	color: var(--ah-theme-ink);
	text-decoration: none;
}

.site-logo-img {
	display: block;
	width: auto;
	height: 38px;
	max-width: 190px;
	object-fit: contain;
	border-radius: 0;
	background: transparent;
	filter: brightness(0);
}

.ah-custom-logo {
	filter: brightness(0);
}

.site-logo-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	color: var(--ah-theme-teal);
}

.site-logo-mark .site-icon {
	width: 24px;
	height: 24px;
}

.site-logo-text {
	display: block;
	min-width: 0;
	color: var(--ah-theme-ink);
	font-size: 18px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0;
	text-transform: uppercase;
	white-space: nowrap;
}

.site-nav {
	flex: 1 1 auto;
	display: flex;
	justify-content: center;
	min-width: 0;
}

.site-menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 42px;
	height: 38px;
	padding: 0;
	border: 1px solid rgba(91, 53, 177, 0.16);
	border-radius: 8px;
	background: #fff;
	color: var(--ah-theme-ink);
	cursor: pointer;
}

.site-menu-toggle span {
	display: block;
	width: 18px;
	height: 2px;
	border-radius: 99px;
	background: currentColor;
}

.site-menu-toggle b {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.site-nav-list {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: center;
	gap: 3px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav-item {
	position: relative;
}

.site-nav-link,
.site-submenu-link,
.header-button,
.header-icon-button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 38px;
	padding: 7px 9px;
	border: 1px solid transparent;
	border-radius: 8px;
	color: var(--ah-theme-ink);
	background: transparent;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0;
	text-decoration: none;
	text-align: start;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.site-nav-link span,
.site-submenu-link span,
.header-button span {
	white-space: nowrap;
}

.site-nav-link .site-icon,
.site-submenu-link .site-icon,
.header-button .site-icon,
.header-icon-button .site-icon {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
}

.site-icon {
	display: block;
}

.site-icon-chevron {
	width: 14px;
	height: 14px;
	margin-inline-start: 2px;
}

.site-nav-link:hover,
.site-nav-link:focus-visible,
.site-submenu-link:hover,
.site-submenu-link:focus-visible {
	background: rgba(91, 53, 177, 0.08);
	border-color: rgba(91, 53, 177, 0.12);
	color: var(--ah-theme-teal);
}

.site-nav-item.is-active > .site-nav-link,
.site-submenu li.is-active > .site-submenu-link {
	background: rgba(91, 53, 177, 0.12);
	border-color: rgba(91, 53, 177, 0.18);
	color: var(--ah-theme-teal);
}

.site-nav-item.has-submenu > .site-submenu {
	position: absolute;
	inset-block-start: 100%;
	inset-inline-start: 0;
	display: none;
	width: 252px;
	margin: 0;
	padding: 8px;
	border: 1px solid var(--ah-theme-line);
	border-radius: 8px;
	background: #ffffff;
	box-shadow: 0 16px 36px rgba(19, 32, 43, 0.12);
	list-style: none;
	z-index: 25;
}

.site-nav-item.has-submenu > .site-submenu::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	inset-block-start: -10px;
	height: 10px;
}

html[dir="rtl"] .site-nav-item.has-submenu > .site-submenu {
	inset-inline-start: auto;
	inset-inline-end: 0;
}

.site-nav-item.has-submenu:hover > .site-submenu,
.site-nav-item.has-submenu:focus-within > .site-submenu {
	display: grid;
	gap: 4px;
}

.site-submenu-link {
	width: 100%;
	justify-content: flex-start;
	min-height: 38px;
	padding: 8px 10px;
	font-size: 13px;
}

html[dir="rtl"] .site-header-inner {
	flex-direction: row-reverse;
}

html[dir="rtl"] .site-logo {
	flex-direction: row-reverse;
}

html[dir="rtl"] .site-nav-list {
	flex-direction: row-reverse;
}

html[dir="rtl"] .site-nav-link,
html[dir="rtl"] .site-submenu-link,
html[dir="rtl"] .header-button {
	flex-direction: row-reverse;
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
	min-width: 0;
}

.header-icon-button {
	width: 40px;
	padding: 0;
	justify-content: center;
}

.header-language-toggle {
	min-width: 58px;
	padding-inline: 8px;
}

.header-language-code {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0;
}

.header-button {
	background: var(--ah-theme-teal);
	border-color: var(--ah-theme-teal);
	color: #ffffff;
	box-shadow: 0 10px 22px rgba(91, 53, 177, 0.16);
}

.header-button:hover,
.header-button:focus-visible {
	background: #4b2a95;
	border-color: #4b2a95;
	color: #ffffff;
	transform: translateY(-1px);
}

.header-logout-button {
	background: #ffffff;
	border-color: rgba(91, 53, 177, 0.14);
	color: var(--ah-theme-teal);
}

.header-logout-button:hover,
.header-logout-button:focus-visible {
	background: rgba(91, 53, 177, 0.08);
	border-color: rgba(91, 53, 177, 0.18);
	color: var(--ah-theme-teal);
}

.site-main {
	min-height: 62vh;
}

.site-main > article > .entry-header,
.site-main > article > .entry-content {
	width: min(1180px, calc(100% - 32px));
	margin: 0 auto;
}

.site-main > article > .entry-header {
	padding: 34px 0 0;
}

.site-main > article > .entry-title {
	font-size: clamp(36px, 6vw, 64px);
	line-height: 1;
	letter-spacing: 0;
}

.site-footer {
	border-top: 1px solid var(--ah-theme-line);
	background: #12101b;
	color: #ffffff;
}

.site-footer-inner {
	display: grid;
	grid-template-columns: minmax(240px, 1.35fr) repeat(3, minmax(150px, 1fr));
	gap: 28px;
	padding: 32px 0;
}

.site-footer section,
.site-footer .footer-bottom {
	text-align: start;
}

.site-footer h2,
.site-footer h3 {
	margin: 0 0 10px;
	letter-spacing: 0;
	overflow-wrap: anywhere;
}

.site-footer p {
	margin: 0;
	color: rgba(255, 255, 255, 0.82);
	line-height: 1.75;
}

.site-footer ul {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer a {
	color: #ffffff;
	text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
	color: #d8cbff;
}

.footer-newsletter {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 8px;
	margin-top: 18px;
}

.footer-newsletter input,
.footer-newsletter button {
	min-height: 42px;
	border: 1px solid rgba(255, 255, 255, 0.24);
	border-radius: 6px;
	font: inherit;
}

.footer-newsletter input {
	min-width: 0;
	padding: 0 12px;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}

.footer-newsletter input::placeholder {
	color: rgba(255, 255, 255, 0.65);
}

.footer-newsletter button {
	padding: 0 16px;
	background: #fff;
	color: #21173b;
	font-weight: 700;
	cursor: pointer;
}

.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.16);
	padding: 14px 0;
	color: rgba(255, 255, 255, 0.86);
	font-size: 14px;
}

@media (max-width: 1240px) {
	.site-header-inner {
		width: min(100% - 16px, 1240px);
		gap: 8px;
	}

	.site-logo-img {
		height: 34px;
		max-width: 160px;
	}

	.site-nav-list {
		gap: 2px;
	}

	.site-nav-link,
	.header-button,
	.header-icon-button {
		min-height: 36px;
		padding-inline: 7px;
		font-size: 12px;
	}

	.site-nav-link .site-icon,
	.site-submenu-link .site-icon,
	.header-button .site-icon,
	.header-icon-button .site-icon {
		width: 15px;
		height: 15px;
	}
}

@media (max-width: 960px) {
	.site-header-inner {
		flex-direction: row;
		align-items: center;
		gap: 6px;
		min-height: 58px;
		padding: 6px 0;
		position: relative;
	}

	html[dir="rtl"] .site-header-inner {
		flex-direction: row-reverse;
	}

	.site-logo {
		align-self: center;
	}

	html[dir="rtl"] .site-logo {
		align-self: center;
	}

	.site-logo-text {
		font-size: 16px;
	}

	.site-logo-img {
		height: 30px;
		max-width: 128px;
	}

	.site-menu-toggle {
		display: inline-flex;
		flex-direction: column;
		flex: 0 0 auto;
		order: 2;
	}

	html[dir="rtl"] .site-menu-toggle {
		order: 2;
	}

	.site-nav {
		position: absolute;
		inset-block-start: calc(100% + 8px);
		inset-inline: 0;
		display: none;
		width: 100%;
		max-height: calc(100vh - 86px);
		padding: 8px;
		border: 1px solid var(--ah-theme-line);
		border-radius: 10px;
		background: #fff;
		box-shadow: 0 18px 48px rgba(19, 32, 43, 0.14);
		overflow: auto;
	}

	.site-header.is-menu-open .site-nav {
		display: block;
	}

	.site-nav-list {
		width: 100%;
		min-width: 0;
		flex-direction: row;
		align-items: center;
		justify-content: flex-start;
		gap: 4px;
		flex-wrap: wrap;
	}

	html[dir="rtl"] .site-nav-list {
		flex-direction: row-reverse;
	}

	.site-nav-link,
	.site-submenu-link {
		width: 100%;
		justify-content: flex-start;
	}

	html[dir="rtl"] .site-nav-link,
	html[dir="rtl"] .site-submenu-link {
		justify-content: flex-start;
	}

	.site-nav-item.has-submenu > .site-submenu {
		position: static;
		display: none;
		width: 100%;
		margin: 4px 0 0;
		padding: 8px;
		box-shadow: none;
		background: var(--ah-theme-soft);
	}

	.site-nav-item.has-submenu > .site-submenu::before {
		display: none;
	}

	.site-nav-item {
		flex: 1 1 calc(50% - 4px);
		min-width: min(210px, 100%);
	}

	.site-nav-item.has-submenu {
		flex-basis: 100%;
	}

	.site-nav-item.has-submenu:hover > .site-submenu,
	.site-nav-item.has-submenu:focus-within > .site-submenu {
		display: none;
	}

	.site-nav-item.has-submenu.is-submenu-open > .site-submenu {
		display: grid;
		gap: 4px;
	}

	html[dir="rtl"] .site-nav-item.has-submenu > .site-submenu {
		inset-inline-start: auto;
		inset-inline-end: 0;
	}

	.header-actions {
		display: flex;
		flex: 0 0 auto;
		align-items: center;
		gap: 5px;
		width: auto;
		min-width: 0;
		margin-inline-start: auto;
	}

	html[dir="rtl"] .header-actions {
		margin-inline-start: 0;
		margin-inline-end: auto;
	}

	.site-nav-link,
	.header-button,
	.header-icon-button {
		min-height: 34px;
		padding-inline: 6px;
		font-size: 11px;
	}

	.site-nav-link .site-icon,
	.header-button .site-icon {
		display: none;
	}

	.header-language-toggle {
		min-width: 42px;
	}

	.header-auth-button span,
	.header-profile-button span {
		max-width: 72px;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.header-icon-button {
		width: 36px;
	}

	.site-footer-inner {
		grid-template-columns: 1fr;
	}
}

@media (min-width: 961px) and (max-width: 1140px) {
	.site-header-inner {
		gap: 6px;
	}

	.site-nav-list {
		gap: 1px;
	}

	.site-nav-link,
	.header-button,
	.header-icon-button {
		min-height: 34px;
		padding-inline: 6px;
		font-size: 11.5px;
	}
}

@media (max-width: 520px) {
	.site-header-inner,
	.site-footer-inner,
	.site-main > article > .entry-header,
	.site-main > article > .entry-content {
		width: 100%;
		padding-left: 10px;
		padding-right: 10px;
	}

	.site-logo {
		gap: 8px;
	}

	.site-logo-mark {
		width: 30px;
		height: 30px;
	}

	.site-logo-mark .site-icon {
		width: 21px;
		height: 21px;
	}

	.site-logo-text {
		font-size: 15px;
	}

	.site-logo-img {
		height: 28px;
		max-width: 118px;
	}

	.site-nav-list {
		display: grid;
		grid-template-columns: 1fr;
	}

	.site-nav-item {
		min-width: 0;
		width: 100%;
	}

	.site-nav-link,
	.site-submenu-link,
	.header-button {
		padding-inline: 5px;
		font-size: 11px;
	}

	.site-nav-link,
	.site-submenu-link {
		min-height: 34px;
	}

	.header-button {
		width: 36px;
		padding: 0;
		justify-content: center;
	}

	.header-button .site-icon {
		display: block;
	}

	.header-button span {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}

	.footer-bottom {
		font-size: 13px;
	}

	.footer-newsletter {
		grid-template-columns: 1fr;
	}
}

/* Final header responsiveness pass. Keep desktop one-line and mobile menu stable. */
.site-header,
.site-header * {
	min-width: 0;
}

.site-header-inner {
	flex-wrap: nowrap;
}

.site-nav {
	min-width: 0;
}

.site-nav-list {
	min-width: 0;
}

.site-nav-link,
.site-submenu-link,
.header-button,
.header-icon-button {
	white-space: nowrap;
}

@media (min-width: 961px) {
	.site-logo {
		flex: 0 1 auto;
	}

	.site-nav {
		flex: 1 1 auto;
		min-width: 0;
	}

	.site-nav-list {
		justify-content: center;
	}

	.header-actions {
		flex: 0 0 auto;
	}
}

@media (max-width: 960px) {
	.site-header {
		z-index: 1000;
	}

	.site-header-inner {
		width: min(100% - 20px, 760px);
	}

	.site-logo {
		max-width: calc(100% - 132px);
	}

	.site-nav {
		inset-block-start: calc(100% + 6px);
		max-height: calc(100vh - 74px);
	}

	.site-nav-list,
	html[dir="rtl"] .site-nav-list {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		flex-direction: column;
		align-items: stretch;
		justify-content: stretch;
	}

	.site-nav-item,
	.site-nav-item.has-submenu {
		width: 100%;
		min-width: 0;
		flex: none;
	}

	.site-nav-link,
	.site-submenu-link {
		width: 100%;
		justify-content: flex-start;
		text-align: start;
		white-space: normal;
	}

	html[dir="rtl"] .site-nav-link,
	html[dir="rtl"] .site-submenu-link {
		justify-content: flex-start;
		text-align: right;
	}

	.site-nav-item.has-submenu > .site-submenu {
		min-width: 0;
	}
}

@media (max-width: 420px) {
	.site-logo {
		max-width: calc(100% - 118px);
	}

	.site-logo-img {
		max-width: 100px;
	}

	.header-actions {
		gap: 4px;
	}

	.header-icon-button,
	.header-button {
		width: 34px;
		min-width: 34px;
	}
}

/* Mobile header final layout: logo + actions + menu, no squeeze/jump. */
@media (max-width: 640px) {
	.site-header-inner {
		display: grid;
		grid-template-columns: minmax(96px, 1fr) auto auto;
		align-items: center;
		column-gap: 8px;
		width: 100%;
		height: 58px;
		min-height: 58px;
		padding: 6px 12px;
	}

	html[dir="rtl"] .site-header-inner {
		grid-template-columns: auto auto minmax(96px, 1fr);
	}

	.site-logo {
		grid-column: 1;
		max-width: 100%;
		min-width: 0;
	}

	html[dir="rtl"] .site-logo {
		grid-column: 3;
		justify-self: end;
	}

	.site-logo-img {
		width: auto;
		height: 30px;
		max-width: min(138px, 38vw);
		object-fit: contain;
	}

	.header-actions {
		grid-column: 2;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		gap: 5px;
		margin: 0;
	}

	html[dir="rtl"] .header-actions {
		grid-column: 1;
		justify-content: flex-start;
		margin: 0;
	}

	.site-menu-toggle {
		grid-column: 3;
		justify-self: end;
		order: initial;
		width: 42px;
		height: 42px;
	}

	html[dir="rtl"] .site-menu-toggle {
		grid-column: 2;
		justify-self: center;
		order: initial;
	}

	.site-nav {
		position: absolute;
		display: none;
		inset-block-start: calc(100% + 4px);
		grid-column: 1 / -1;
		inset-inline: 12px;
		width: auto;
	}

	.site-header.is-menu-open .site-nav {
		display: block;
	}

	.header-language-toggle {
		width: 40px;
		min-width: 40px;
		padding: 0;
	}

	.header-language-code {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}

	.header-auth-button,
	.header-profile-button {
		width: 40px;
		min-width: 40px;
		padding: 0;
		justify-content: center;
	}

	.header-auth-button span,
	.header-profile-button span {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}
}

/* Hard mobile header lock. This intentionally wins over all earlier rules. */
@media (max-width: 700px) {
	body .site-header {
		min-height: 58px !important;
	}

	body .site-header .site-header-inner {
		display: grid !important;
		grid-template-columns: minmax(88px, 1fr) 84px 42px !important;
		grid-template-rows: 46px !important;
		align-items: center !important;
		gap: 0 8px !important;
		width: 100% !important;
		height: 58px !important;
		min-height: 58px !important;
		max-height: 58px !important;
		margin: 0 !important;
		padding: 6px 12px !important;
		overflow: visible !important;
	}

	html[dir="rtl"] body .site-header .site-header-inner {
		grid-template-columns: 84px 42px minmax(88px, 1fr) !important;
	}

	body .site-header .site-logo {
		grid-column: 1 !important;
		grid-row: 1 !important;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		justify-self: start !important;
		align-self: center !important;
	}

	html[dir="rtl"] body .site-header .site-logo {
		grid-column: 3 !important;
		justify-self: end !important;
	}

	body .site-header .site-logo-img {
		width: auto !important;
		height: 30px !important;
		max-width: min(138px, 40vw) !important;
		object-fit: contain !important;
	}

	body .site-header .header-actions {
		grid-column: 2 !important;
		grid-row: 1 !important;
		display: flex !important;
		flex: none !important;
		align-items: center !important;
		justify-content: flex-end !important;
		gap: 4px !important;
		width: 84px !important;
		min-width: 84px !important;
		max-width: 84px !important;
		height: 42px !important;
		margin: 0 !important;
		padding: 0 !important;
		justify-self: end !important;
		align-self: center !important;
	}

	html[dir="rtl"] body .site-header .header-actions {
		grid-column: 1 !important;
		justify-self: start !important;
	}

	body .site-header .site-menu-toggle {
		grid-column: 3 !important;
		grid-row: 1 !important;
		display: inline-flex !important;
		flex: none !important;
		order: 0 !important;
		width: 42px !important;
		min-width: 42px !important;
		height: 42px !important;
		margin: 0 !important;
		justify-self: end !important;
		align-self: center !important;
	}

	html[dir="rtl"] body .site-header .site-menu-toggle {
		grid-column: 2 !important;
		justify-self: center !important;
	}

	body .site-header .header-icon-button,
	body .site-header .header-button,
	body .site-header .header-language-toggle,
	body .site-header .header-auth-button,
	body .site-header .header-profile-button {
		display: inline-flex !important;
		width: 40px !important;
		min-width: 40px !important;
		max-width: 40px !important;
		height: 40px !important;
		min-height: 40px !important;
		padding: 0 !important;
		justify-content: center !important;
		align-items: center !important;
		overflow: hidden !important;
	}

	body .site-header .header-language-code,
	body .site-header .header-auth-button span,
	body .site-header .header-profile-button span {
		display: none !important;
	}

	body .site-header .site-nav {
		position: absolute !important;
		display: none !important;
		inset-block-start: calc(100% + 4px) !important;
		inset-inline: 12px !important;
		width: auto !important;
		max-height: calc(100vh - 74px) !important;
	}

	body .site-header.is-menu-open .site-nav {
		display: block !important;
	}
}
