/* =========================================================
   STUDYDUNIA — ARTICLE PAGE
   ========================================================= */


/* ── ARTICLE GRID ── */

.article-grid {
	display: grid;
	grid-template-columns: 1fr var(--theme-sidebar-width);
	gap: var(--theme-sidebar-gap);
}

body.no-sidebar .article-grid {
	grid-template-columns: 1fr;
}


/* =========================================================
   FEATURED IMAGE
   ========================================================= */

.article-featured-img {
	width: 100%;
	height: 360px;
	border-radius: 20px;
	overflow: hidden;
	position: relative;
	margin-bottom: 20px;
}

.article-featured-img .sd-thumb-img,
.article-featured-img .sd-thumb-placeholder {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.article-tag-abs {
	position: absolute;
	bottom: 20px;
	left: 20px;
	background: rgba(255,255,255,.9);
	color: var(--theme-success);
	font-size: 11px;
	font-weight: 800;
	padding: 4px 12px;
	border-radius: 9999px;
}


/* =========================================================
   POST TITLE
   ========================================================= */

.article-title {
	margin: 0 0 14px;
	font-family: var(--theme-font-heading);
	font-size: 32px;
	font-weight: 900;
	line-height: 1.25;
	color: var(--theme-text);
}


/* =========================================================
   POST META
   ========================================================= */

.article-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	margin-bottom: 16px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--theme-muted);
}

.article-meta .author {
	font-weight: 600;
	color: var(--theme-text);
}

.sd-author {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.sd-author-avatar {
	border-radius: 50%;
}

.sd-author a:hover {
	color: var(--theme-primary);
}


/* =========================================================
   SOCIAL SHARE
   ========================================================= */

.share-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 24px;
}

.share-label {
	font-size: 13px;
	font-weight: 500;
	color: var(--theme-muted);
}

.share-btn {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 13px;
	transition:
		transform .15s ease,
		opacity .15s ease;
}

.share-btn:hover {
	transform: scale(1.1);
	opacity: .85;
}


/* =========================================================
   PILLAR NAVIGATION
   ========================================================= */

.pillar-nav {
	width: 100%;
	background: var(--theme-surface);
	border: var(--theme-border-width) solid var(--theme-border);
	border-radius: var(--theme-card-radius);
	overflow: hidden;
	margin-bottom: 24px;
	box-shadow: var(--theme-shadow);
}

.pillar-nav-inner {
	display: flex;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.pillar-btn {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 12px 20px;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	border-right: var(--theme-border-width) solid var(--theme-border);
	transition:
		background .15s,
		color .15s;
	color: var(--theme-text);
	position: relative;
}

.pillar-btn:last-child {
	border-right: none;
}

.pillar-btn:hover,
.pillar-btn.open,
.pillar-btn[aria-expanded="true"] {
	background: var(--theme-primary);
	color: #fff;
}

.pillar-dropdown {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	background: var(--theme-surface);
	border: var(--theme-border-width) solid var(--theme-border);
	border-radius: 0 0 12px 12px;
	box-shadow: var(--theme-shadow-md);
	z-index: 50;
}

.pillar-btn.open .pillar-dropdown,
.pillar-btn[aria-expanded="true"] .pillar-dropdown {
	display: block;
}

.pillar-dropdown a {
	display: block;
	padding: 10px 16px;
	font-size: 13px;
	color: var(--theme-text);
	transition:
		background .15s,
		color .15s;
}

.pillar-dropdown a:hover {
	background: var(--theme-primary-light, #e8f0fd);
	color: var(--theme-primary);
}


/* =========================================================
   QUICK SUMMARY / TLDR
   ========================================================= */

.tldr-box {
	background: color-mix(in srgb, var(--theme-accent) 8%, white);
	border: 1px solid color-mix(in srgb, var(--theme-accent) 35%, white);
	border-radius: 16px;
	padding: 24px;
	margin-bottom: 28px;
}

.tldr-badge {
	display: inline-block;
	background: var(--theme-accent);
	color: #fff;
	font-size: 10px;
	font-weight: 800;
	padding: 4px 12px;
	border-radius: 9999px;
	margin-bottom: 14px;
}

.tldr-list {
	list-style: none;
}

.tldr-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 10px;
	font-size: 14px;
}

.tldr-item:last-child {
	margin-bottom: 0;
}

.tldr-check {
	color: var(--theme-accent);
	flex-shrink: 0;
	font-size: 16px;
}


/* =========================================================
   ARTICLE BODY
   ========================================================= */

.article-body {
	width: 100%;
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 0;
	font-family: var(--theme-font-article);
	font-size: 17px;
	line-height: 1.9;
	color: #1f2937;
}

.article-body p {
	margin: 0 0 22px;
}

.article-body h2 {
	margin: 38px 0 14px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--theme-primary-light, #e8f0fd);
	font-family: var(--theme-font-heading);
	font-size: 24px;
	font-weight: 800;
	line-height: 1.3;
	color: var(--theme-text);
}

.article-body h3 {
	margin: 28px 0 12px;
	font-family: var(--theme-font-heading);
	font-size: 19px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--theme-text);
}

.article-body h4 {
	margin: 22px 0 10px;
	font-family: var(--theme-font-heading);
	font-size: var(--theme-font-size-h4);
	font-weight: 700;
	color: var(--theme-text);
}

.article-body ul {
	list-style: none;
	margin: 0 0 22px;
	padding: 0;
}

.article-body ul li {
	display: flex;
	gap: 10px;
	margin-bottom: 12px;
	font-size: 16px;
	line-height: 1.6;
}

.article-body ul li:last-child {
	margin-bottom: 0;
}

.article-body ul li::before {
	content: "•";
	color: var(--theme-primary);
	font-size: 20px;
	flex-shrink: 0;
	margin-top: -2px;
}

.article-body ol {
	margin: 0 0 22px;
	padding-left: 24px;
}

.article-body ol li {
	margin-bottom: 12px;
	font-size: 16px;
	line-height: 1.6;
}

.article-body ol li:last-child {
	margin-bottom: 0;
}

.article-body strong {
	font-weight: 700;
	color: var(--theme-text);
}

.article-body a {
	color: var(--theme-primary);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.article-body blockquote {
	border-left: 4px solid var(--theme-primary);
	padding: 4px 20px;
	margin: 24px 0;
	font-style: italic;
	color: var(--theme-muted);
}

.article-body img {
	border-radius: var(--theme-card-radius);
	margin: 20px 0;
}

.article-body figcaption {
	font-size: 12px;
	color: var(--theme-muted);
	text-align: center;
	margin-top: 6px;
}

.article-body .wp-block-buttons a,
.article-body .wp-block-button__link {
	display: inline-flex;
	background: var(--theme-primary);
	color: #fff;
	padding: 10px 22px;
	border-radius: var(--theme-button-radius);
	font-weight: 600;
	text-decoration: none;
	font-family: var(--theme-font-heading);
}


/* =========================================================
   DATA TABLE
   ========================================================= */

.data-table {
	width: 100%;
	border-collapse: collapse;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: var(--theme-shadow);
	margin: 28px 0;
	font-size: 13px;
}

.data-table thead th {
	background: var(--theme-primary);
	color: #fff;
	padding: 12px 16px;
	text-align: left;
	font-weight: 600;
}

.data-table tbody tr:nth-child(even) {
	background: var(--theme-background);
}

.data-table tbody tr:nth-child(odd) {
	background: var(--theme-surface);
}

.data-table tbody td {
	padding: 11px 16px;
	border-bottom: var(--theme-border-width) solid var(--theme-border);
	color: var(--theme-text);
}

.data-table.green-head thead th {
	background: var(--theme-success);
}

.article-body table:not(.data-table) {
	width: 100%;
	border-collapse: collapse;
	margin: 24px 0;
	font-size: 14px;
}

.article-body table:not(.data-table) th,
.article-body table:not(.data-table) td {
	border: var(--theme-border-width) solid var(--theme-border);
	padding: 10px 14px;
	text-align: left;
}

.article-body table:not(.data-table) th {
	background: var(--theme-background);
	font-weight: 700;
}


/* =========================================================
   CUSTOM STUDYDUNIA FAQ
   ========================================================= */

.faq-section {
	width: 100%;
	margin: 38px 0 34px;
}

.faq-section-title {
	margin: 0 0 18px;
	font-family: var(--theme-font-heading);
	font-size: 22px;
	font-weight: 800;
	line-height: 1.35;
	color: var(--theme-text);
}


/* ── FAQ ITEM ── */

.faq-item {
	width: 100%;
	margin: 0 0 14px;
	background: var(--theme-surface);
	border: 1px solid var(--theme-border);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}

.faq-item:last-child {
	margin-bottom: 0;
}


/* ── QUESTION BUTTON ── */

.faq-btn {
	position: relative;

	display: flex;
	align-items: center;
	justify-content: space-between;

	width: 100%;
	min-height: 84px;

	margin: 0;
	padding: 18px 30px 18px 34px;

	border: 0;
	background: var(--theme-surface);

	font-family: var(--theme-font-heading);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--theme-text);

	text-align: left;
	cursor: pointer;

	transition:
		background .2s ease,
		color .2s ease;
}

.faq-btn:hover {
	background: #fafcff;
}


/* ── QUESTION LEFT SIDE ── */

.faq-btn-left {
	display: flex;
	align-items: center;
	gap: 20px;
	min-width: 0;
	padding-right: 20px;
}


/* ── NUMBER ── */

.faq-num {
	display: flex;
	align-items: center;
	justify-content: center;

	width: 46px;
	height: 46px;

	flex: 0 0 46px;

	border-radius: 50%;

	background: var(--theme-primary-light, #e8f0fd);
	color: var(--theme-primary);

	font-family: var(--theme-font-heading);
	font-size: 18px;
	font-weight: 800;
	line-height: 1;
}


/* ── QUESTION TEXT ── */

.faq-q-text {
	display: block;
	min-width: 0;
}


/* ── ARROW ── */

.faq-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	width: 28px;
	height: 28px;

	flex: 0 0 28px;

	font-size: 18px;
	line-height: 1;
	color: var(--theme-muted);

	transition:
		transform .2s ease,
		color .2s ease;
}

.faq-item.open .faq-arrow {
	transform: rotate(180deg);
	color: var(--theme-primary);
}


/* ── ANSWER ── */

.faq-answer {
	margin: 0;
	padding: 22px 34px 26px 100px;

	border-top: 1px solid var(--theme-border);

	background: var(--theme-surface);

	font-family: var(--theme-font-article);
	font-size: 16px;
	line-height: 1.75;
	color: var(--theme-muted);
}

.faq-answer[hidden] {
	display: none;
}

.faq-answer p {
	margin: 0 0 14px;
}

.faq-answer p:last-child {
	margin-bottom: 0;
}

.faq-answer a {
	color: var(--theme-primary);
	text-decoration: underline;
	text-underline-offset: 2px;
}


/* =========================================================
   COMMENTS
   ========================================================= */

#sd-comments {
	width: 100%;
	margin: 38px 0 34px;
	padding-top: 26px;
	border-top: 1px solid var(--theme-border);
}

#sd-comments .comments-title,
#sd-comments .comment-reply-title {
	margin: 0 0 14px;
	font-family: var(--theme-font-heading);
	font-size: 18px;
	font-weight: 800;
	line-height: 1.35;
	color: var(--theme-text);
}

#sd-comments .logged-in-as,
#sd-comments .comment-notes {
	margin: 0 0 14px;
	font-size: 12px;
	line-height: 1.6;
	color: var(--theme-muted);
}

#sd-comments label {
	display: block;
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 600;
	color: var(--theme-text);
}

#sd-comments textarea,
#sd-comments input[type="text"],
#sd-comments input[type="email"],
#sd-comments input[type="url"] {
	width: 100%;
	padding: 12px 14px;
	background: var(--theme-surface);
	border: 1px solid var(--theme-border);
	border-radius: 8px;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
	color: var(--theme-text);
	outline: none;
	transition:
		border-color .15s ease,
		box-shadow .15s ease;
}

#sd-comments textarea {
	min-height: 150px;
	resize: vertical;
}

#sd-comments textarea:focus,
#sd-comments input[type="text"]:focus,
#sd-comments input[type="email"]:focus,
#sd-comments input[type="url"]:focus {
	border-color: var(--theme-primary);
	box-shadow: 0 0 0 3px color-mix(
		in srgb,
		var(--theme-primary) 12%,
		transparent
	);
}

#sd-comments .form-submit {
	margin: 14px 0 0;
}

#sd-comments .submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 18px;
	border: 0;
	border-radius: 8px;
	background: var(--theme-primary);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	transition:
		transform .15s ease,
		opacity .15s ease;
}

#sd-comments .submit:hover {
	opacity: .9;
	transform: translateY(-1px);
}


/* =========================================================
   SINGLE POST PAGE
   ========================================================= */

.sd-single-page {
	width: 100%;
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding-top: 28px;
}


/* =========================================================
   SINGLE POST DESKTOP LAYOUT
   ========================================================= */

.sd-article-layout {
	width: 100%;
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;

	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 36px;
	align-items: start;
}

.sd-single-article {
	width: 100%;
	min-width: 0;
}

.sd-single-article > * {
	max-width: 100%;
}


/* =========================================================
   FAQ MOBILE
   ========================================================= */

@media (max-width: 768px) {

	.faq-section {
		margin: 30px 0;
	}

	.faq-section-title {
		font-size: 20px;
		margin-bottom: 14px;
	}

	.faq-item {
		margin-bottom: 10px;
		border-radius: 12px;
	}

	.faq-btn {
		min-height: 66px;
		padding: 14px 18px;
		font-size: 15px;
	}

	.faq-btn-left {
		gap: 12px;
		padding-right: 10px;
	}

	.faq-num {
		width: 38px;
		height: 38px;
		flex-basis: 38px;
		font-size: 15px;
	}

	.faq-arrow {
		width: 24px;
		height: 24px;
		font-size: 15px;
	}

	.faq-answer {
		padding: 16px 18px 18px 68px;
		font-size: 14px;
		line-height: 1.7;
	}

}