/**
 * Forex Daily — theme component styles
 * Ported as-is from the FXD Core plugin (same class names, same
 * visual output — zero markup/CSS drift after migration).
 * Requires fxd-colors.css (--fxd-* tokens) loaded first.
 * Covers: Article Header, Social Share Bar, FAQ Accordion, Back to Top.
 */

/* ════════════════════════════════════════
   ARTICLE HEADER
   ════════════════════════════════════════ */
.fah-wrapper {
	margin-bottom: 2rem;
	font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.fah-breadcrumb-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 7px;
}

.fah-breadcrumbs { flex: 1; min-width: 0; }
.page .fah-breadcrumbs { margin-bottom: 0; }

.fah-breadcrumbs .rank-math-breadcrumb,
.fah-breadcrumbs .rank-math-breadcrumb p {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 5px;
	margin: 0;
	padding: 0;
	font-size: 11.5px;
	color: var(--fxd-text-muted);
	line-height: 1.4;
	letter-spacing: 0.01em;
	overflow: hidden;
	min-width: 0;
}
.fah-breadcrumbs .rank-math-breadcrumb a {
	color: var(--fxd-text-muted);
	text-decoration: none;
	transition: color 0.15s;
	white-space: nowrap;
	flex-shrink: 0;
}
.fah-breadcrumbs .rank-math-breadcrumb a:hover { color: var(--fxd-primary); }
.fah-breadcrumbs .rank-math-breadcrumb .separator { color: var(--fxd-border); margin: 0 1px; flex-shrink: 0; }
.fah-breadcrumbs .rank-math-breadcrumb span:last-child {
	color: var(--fxd-text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
	max-width: 100%;
}

.fah-badge-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 5px;
	margin: 12px 0;
	position: relative;
}

/* Category badge — fixed: was rendering white text on white bg */
.fah-category-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: var(--fxd-surface-alt);
	border: 1px solid var(--fxd-border);
	border-radius: 5px;
	padding: 7px 9px;
	font-size: 10px;
	font-weight: 700;
	color: var(--fxd-primary);
	text-transform: uppercase;
	letter-spacing: 0.07em;
	line-height: 1;
	text-decoration: none;
	transition: background 0.15s, border-color 0.15s;
}
.fah-category-badge:hover {
	background: var(--fxd-primary-tint);
	border-color: var(--fxd-primary);
	color: var(--fxd-primary);
	text-decoration: none;
}

.fah-traders-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: var(--fxd-surface);
	border: 1px solid var(--fxd-border);
	border-radius: 5px;
	padding: 7px 9px;
	font-size: 10px;
	font-weight: 700;
	color: var(--fxd-primary);
	text-transform: uppercase;
	letter-spacing: 0.07em;
	line-height: 1;
}
.fah-trophy-icon { width: 10px; height: 10px; flex-shrink: 0; }

.fah-affiliate-wrap { position: relative; display: inline-flex; align-items: center; flex-shrink: 0; }
.fah-affiliate-icon {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--fxd-surface-alt);
	border: 1px solid var(--fxd-border);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--fxd-text-muted);
	transition: border-color 0.15s, color 0.15s;
	flex-shrink: 0;
	margin-left: 5px;
}
.fah-affiliate-icon svg { width: 11px; height: 11px; }
.fah-affiliate-icon:hover,
.fah-affiliate-icon:focus { border-color: var(--fxd-primary); color: var(--fxd-primary); outline: none; }

.fah-aff-tooltip {
	display: none;
	position: absolute;
	right: 0;
	top: 36px;
	width: 270px;
	background: var(--fxd-surface-alt);
	border: 1px solid var(--fxd-border);
	border-radius: 8px;
	padding: 14px 16px;
	z-index: 999;
	box-shadow: 0 2px 16px rgba(0,0,0,.08);
}
.fah-aff-tooltip::before {
	content: '';
	position: absolute;
	top: -6px; right: 11px;
	width: 10px; height: 10px;
	background: var(--fxd-surface-alt);
	border-left: 1px solid var(--fxd-border);
	border-top: 1px solid var(--fxd-border);
	transform: rotate(45deg);
}
.fah-affiliate-wrap:hover .fah-aff-tooltip,
.fah-affiliate-icon:focus + .fah-aff-tooltip { display: block; }

.fah-aff-title { font-size: 10px; font-weight: 700; color: var(--fxd-text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin: 0 0 7px; }
.fah-aff-text { font-size: 12px; color: var(--fxd-text); line-height: 1.65; margin: 0; }
.fah-aff-text a { color: var(--fxd-primary); text-decoration: none; }
.fah-aff-text a:hover { text-decoration: underline; }

.fah-title {
	font-family: 'Sora', sans-serif;
	font-size: clamp(17px, 3.6vw, 28px);
	font-weight: 700;
	color: var(--fxd-text);
	line-height: 1.28;
	margin: 0 0 9px;
	padding: 0;
	letter-spacing: -0.015em;
}

.fah-meta-line {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	font-size: 11px;
	color: var(--fxd-text-muted);
	line-height: 1;
	border-top: 1px solid var(--fxd-border);
	padding: 8px;
	background: var(--fxd-surface);
}

/* Updated badge — de-duplicated (source had two conflicting rules) */
.fah-updated-badge {
	font-size: 9px;
	font-weight: 400;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	background: var(--fxd-primary-tint);
	color: var(--fxd-primary);
	border-radius: 20px;
	padding: 3px 7px;
	margin-right: 4px;
}

.fah-meta-author-wrap { display: inline-flex; align-items: center; gap: 6px; }
.fah-author { font-weight: 600; color: var(--fxd-text); text-decoration: none; transition: color 0.15s; }
.fah-author:hover { color: var(--fxd-primary); text-decoration: none; }

/* Author photo + hover/focus popover card (shared with broker review author card) */
.fah-author-hover { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.fah-author-photo-link { display: flex; line-height: 0; }
.fah-author-photo { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; display: block; }

.fah-author-popover {
	position: fixed;
	z-index: 9999;
	display: flex;
	gap: 12px;
	width: 300px;
	max-width: 80vw;
	background: var(--fxd-surface);
	border: 1px solid var(--fxd-border);
	border-radius: 10px;
	padding: 14px;
	box-shadow: 0 8px 24px rgba(0,0,0,.16);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity .15s ease, transform .15s ease, visibility .15s;
	pointer-events: none;
}
.fah-author-popover.is-visible { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.fah-author-popover__side { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.fah-author-popover__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.fah-author-popover__linkedin {
	display: flex; align-items: center; justify-content: center;
	width: 22px; height: 22px; border-radius: 50%;
	background: var(--fxd-surface-alt); color: var(--fxd-primary);
	transition: background .15s;
}
.fah-author-popover__linkedin:hover { background: var(--fxd-primary); color: #fff; }
.fah-author-popover__body { min-width: 0; }
.fah-author-popover__name { font-size: 13px; font-weight: 700; color: var(--fxd-text); }
.fah-author-popover__title { font-size: 11px; color: var(--fxd-primary); margin-top: 1px; }
.fah-author-popover__bio { font-size: 12px; line-height: 1.55; color: var(--fxd-text-muted); margin: 6px 0 0; }
.fah-author-popover__stats {
	display: flex; flex-direction: column; gap: 4px;
	margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--fxd-border);
}
.fah-author-popover__stat { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--fxd-text); }
.fah-author-popover__stat svg { color: var(--fxd-primary); flex-shrink: 0; }

@media (max-width: 560px) {
	.fah-author-popover { width: 260px; }
}

.fah-meta-sep { display: inline-block; width: 2px; height: 2px; border-radius: 50%; background: var(--fxd-text-muted); opacity: 0.4; margin: 0 7px; flex-shrink: 0; vertical-align: middle; }

.fah-date, .fah-date-updated { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--fxd-text-muted); line-height: 1; }
.fah-date-label { font-weight: 500; color: var(--fxd-text-muted); opacity: 0.75; }
.fah-icon { width: 10px; height: 10px; flex-shrink: 0; color: var(--fxd-text-muted); }
.fah-read-time { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--fxd-text-muted); }

.fah-divider { border: none; border-top: 1px solid var(--fxd-border); margin: 14px 0 0; }

.fah-title-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.fah-title-row .fah-title { margin-bottom: 0; flex: 1; }
.fah-title-row .fah-affiliate-wrap { flex-shrink: 0; margin-left: 0; margin-top: 4px; }

@media (max-width: 540px) {
	.fah-meta-line { row-gap: 6px; }
	.fah-written-by-label, .fah-date-label { display: none; }
	.fah-title { font-size: 20px; }
	.fah-affiliate-wrap { margin-left: 0; }
	.fah-aff-tooltip { right: -8px; left: auto; width: min(270px, calc(100vw - 32px)); transform: none; }
	.fah-aff-tooltip::before { right: 14px; left: auto; }
}

/* ════════════════════════════════════════
   SOCIAL SHARE BAR
   (fixed: source borders/bg were rgba(255,255,255,..) — invisible on a light/white surface)
   ════════════════════════════════════════ */
.fdi-share-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 0;
	margin-top: 20px;
	flex-wrap: wrap;
}
.fdi-share-label {
	color: var(--fxd-text-muted);
	text-transform: uppercase;
	letter-spacing: .06em;
	margin-right: 4px;
	white-space: nowrap;
}
.fdi-share-btn {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	border: 1px solid var(--fxd-border);
	background: var(--fxd-surface-alt);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background .15s, border-color .15s, transform .12s;
	text-decoration: none;
	flex-shrink: 0;
}
.fdi-share-btn svg { width: 16px; height: 16px; fill: var(--fxd-text-muted); transition: fill .15s; display: block; }
.fdi-share-btn:hover { transform: translateY(-2px); }

.fdi-share-btn.fdi-fb:hover { background: rgba(24,119,242,.12); border-color: var(--fxd-facebook); }
.fdi-share-btn.fdi-fb:hover svg { fill: var(--fxd-facebook); }
.fdi-share-btn.fdi-li:hover { background: rgba(10,102,194,.12); border-color: var(--fxd-linkedin); }
.fdi-share-btn.fdi-li:hover svg { fill: var(--fxd-linkedin); }
.fdi-share-btn.fdi-wa:hover { background: rgba(37,211,102,.12); border-color: var(--fxd-whatsapp); }
.fdi-share-btn.fdi-wa:hover svg { fill: var(--fxd-whatsapp); }
.fdi-share-btn.fdi-tg:hover { background: rgba(34,158,217,.12); border-color: var(--fxd-telegram); }
.fdi-share-btn.fdi-tg:hover svg { fill: var(--fxd-telegram); }
.fdi-share-btn.fdi-x:hover { background: rgba(17,17,17,.06); border-color: var(--fxd-x); }
.fdi-share-btn.fdi-x:hover svg { fill: var(--fxd-x); }

/* Compact variant: share bar reused inline inside the article header meta row */
.fdi-header-share { flex-shrink: 0; }
.fdi-header-share .fdi-share-bar { margin-top: 0; padding: 0; }
.fdi-header-share .fdi-share-label { display: none; }
.fdi-header-share .fdi-share-btn { width: 32px; height: 32px; border-radius: 8px; }
.fdi-header-share .fdi-share-btn svg { width: 14px; height: 14px; }
@media (max-width: 600px) {
	.fdi-header-share { width: 100%; justify-content: flex-start; }
}

/* ════════════════════════════════════════
   FAQ ACCORDION
   (source had its own duplicate --wpfaq-* :root + a redundant
   .wpfaq-light override class — both removed, now uses --fxd-* directly)
   ════════════════════════════════════════ */
.wpfaq-wrap { margin: 32px 0; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }

.wpfaq-heading {
	font-size: 1.5em;
	font-weight: 700;
	color: var(--fxd-text);
	margin-bottom: 20px;
	display: block;
	position: relative;
}
.wpfaq-heading::after {
	content: '';
	display: block;
	margin-top: 8px;
	width: 48px;
	height: 3px;
	background: linear-gradient(90deg, var(--fxd-primary-hover), var(--fxd-primary-light) 60%, transparent);
	border-radius: 2px;
}

.wpfaq-list { background: var(--fxd-surface); border: 1px solid var(--fxd-border); border-radius: 12px; overflow: hidden; }
.wpfaq-item { border-bottom: 1px solid var(--fxd-border); }
.wpfaq-item:last-child { border-bottom: none; }

.wpfaq-q {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: transparent;
	border: none;
	padding: 16px 20px;
	cursor: pointer;
	text-align: left;
	color: var(--fxd-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.5;
	transition: background 0.15s;
}
.wpfaq-q:hover { background: var(--fxd-surface-alt); }
.wpfaq-q[aria-expanded="true"] { color: var(--fxd-primary-light); }

.wpfaq-arrow { width: 16px; height: 16px; flex-shrink: 0; color: var(--fxd-text-muted); transition: transform 0.2s ease, color 0.15s; }
.wpfaq-q[aria-expanded="true"] .wpfaq-arrow { transform: rotate(180deg); color: var(--fxd-primary); }

.wpfaq-a { overflow: hidden; }
.wpfaq-a[hidden] { display: none; }
.wpfaq-a-inner { padding: 2px 20px 18px; font-size: 14px; color: var(--fxd-text); line-height: 1.8; }
.wpfaq-a-inner p { margin: 0 0 10px; }
.wpfaq-a-inner p:last-child { margin-bottom: 0; }
.wpfaq-a-inner a { color: var(--fxd-primary-light); text-decoration: underline; }
.wpfaq-a-inner ul, .wpfaq-a-inner ol { padding-left: 20px; margin: 8px 0; }

@media (max-width: 600px) {
	.wpfaq-q { padding: 14px; font-size: 13px; }
	.wpfaq-a-inner { padding: 2px 14px 16px; font-size: 13px; }
	.wpfaq-heading { font-size: 1.15em; }
}

/* ============================================================
   Back to Top
   ============================================================ */
.fbt-btn {
	position: fixed; right: 20px; bottom: 20px; z-index: 9999;
	width: 44px; height: 44px; border-radius: 50%;
	background: var(--fxd-primary); color: #fff; border: none;
	display: flex; align-items: center; justify-content: center;
	cursor: pointer;
	opacity: 0; visibility: hidden; transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
}
.fbt-btn.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.fbt-btn:hover { background: var(--fxd-primary-hover); }
.fbt-btn:focus-visible { outline: 2px solid var(--fxd-primary); outline-offset: 3px; }

/* Scroll progress ring around the back-to-top button */
.fbt-progress {
	position: absolute; top: 0; left: 0;
	width: 100%; height: 100%;
	transform: rotate(-90deg); /* start at 12 o'clock */
	pointer-events: none;
}
.fbt-progress-track { stroke: rgba(255, 255, 255, 0.25); }
.fbt-progress-bar {
	stroke: #fff;
	stroke-linecap: round;
	transition: stroke-dashoffset 0.1s linear;
}
.fbt-icon { position: relative; z-index: 1; }

@media (max-width: 600px) {
	.fbt-btn { right: 14px; bottom: 14px; width: 40px; height: 40px; }
}
