/**
 * FXD Core — merged stylesheet
 * Requires fxd-colors.css (--fxd-* tokens) loaded first.
 * Covers: Article Header, Social Share Bar, FAQ accordion.
 * Heading Styler sizes are output dynamically in PHP (module-heading-styler.php).
 */

/* ════════════════════════════════════════
   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; }

.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;
	border-top: 1px solid var(--fxd-border);
	margin-top: 20px;
	flex-wrap: wrap;
}
.fdi-share-label {
	font-size: 11px;
	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); }

/* ════════════════════════════════════════
   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; }
}

/* ════════════════════════════════════════
   BLOCK HEADINGS (H2–H5)
   Static sizes only — scoped to h#.wp-block-heading,
   so nothing outside real Gutenberg heading blocks is touched.
   ════════════════════════════════════════ */

/* Base styles shared across all headings */
h2.wp-block-heading,
h3.wp-block-heading,
h4.wp-block-heading,
h5.wp-block-heading {
	font-weight: 700;
	color: var(--fxd-text);
	margin-bottom: 20px;
	display: block;
	position: relative;
}
/* Base underline indicator shared across all headings */
h2.wp-block-heading::after,
h3.wp-block-heading::after,
h4.wp-block-heading::after,
h5.wp-block-heading::after {
	content: '';
	display: block;
	margin-top: 8px;
	background: linear-gradient(90deg, var(--fxd-primary-hover), var(--fxd-primary-light) 60%, transparent);
	border-radius: 2px;
}
/* Heading Sizes & Underline Scales */
/* H2 - Master heading size requested */
h2.wp-block-heading {
	font-size: 1.5em;
}
h2.wp-block-heading::after {
	width: 48px;
	height: 3px;
}
/* H3 - Proportional step down (~85%) */
h3.wp-block-heading {
	font-size: 1.25em;
}
h3.wp-block-heading::after {
	width: 40px;
	height: 3px;
}
/* H4 - Sub-section heading (~75%) */
h4.wp-block-heading {
	font-size: 1.1em;
}
h4.wp-block-heading::after {
	width: 32px;
	height: 2px;
}
/* H5 - Smallest structural heading (~65%) */
h5.wp-block-heading {
	font-size: 1em;
}
h5.wp-block-heading::after {
	width: 24px;
	height: 2px;
}

/* ════════════════════════════════════════
   CATEGORY ARCHIVE  ·  [forex_archive]
   SEARCH RESULTS    ·  [forex_search_results]
   (fixed: source referenced the old --fdhf-* dark-mode token
   set — remapped to --fxd-*. Also fixed a typo'd hover color
   `#OOOOOO` (letters, not zeros — invalid CSS, silently ignored)
   and a dark-brown-on-blue contrast bug on the active page number.)
   ════════════════════════════════════════ */

.fca-wrap, .fcsr-wrap { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; max-width: 860px; }
.fcsr-wrap { max-width: 100%; }

/* ── Archive header ── */
.fca-header { margin-bottom: 24px; }
.fca-header__top { display: flex; align-items: flex-start; justify-content: space-between; }
.fca-header__label { display: block; font-size: 10px; color: var(--fxd-text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.fca-header__title { font-size: 24px; font-weight: 800; color: var(--fxd-text); margin: 0 0 4px; line-height: 1.2; }
.fca-header__count { font-size: 12px; color: var(--fxd-text-muted); }
.fca-header__desc { font-size: 13px; color: var(--fxd-text-muted); margin: 10px 0 0; line-height: 1.6; }
.fca-header__line { width: 48px; height: 3px; background: var(--fxd-primary); border-radius: 2px; margin-top: 10px; }

/* ── Card list ── */
.fca-list { display: flex; flex-direction: column; gap: 14px; }
.fca-card {
	display: flex; gap: 16px;
	background: var(--fxd-surface);
	border: 1px solid var(--fxd-border);
	border-radius: 10px; padding: 16px;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.fca-card:hover { border-color: var(--fxd-primary); box-shadow: 0 2px 16px rgba(0,0,0,.08); }

.fca-card__thumb {
	width: 250px; min-width: 140px; height: 180px; border-radius: 7px; overflow: hidden;
	background: var(--fxd-surface-alt); flex-shrink: 0;
	display: flex; align-items: center; justify-content: center;
}
.fca-card__img { width: 100%; height: 100%; object-fit: fill; display: block; }
.fca-card__thumb > a { display: block; width: 100%; height: 100%; }
.fca-card__thumb-placeholder { color: var(--fxd-border); display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }

.fca-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; justify-content: center; }
.fca-card__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.fca-badge, .fcsr-badge {
	display: inline-block;
	background: var(--fxd-success-bg);
	color: var(--fxd-success-text);
	font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 4px;
	text-transform: uppercase; letter-spacing: 0.4px; line-height: 1;
	border: 1px solid var(--fxd-success-border);
}
.fcsr-badge { padding: 3px 8px; }

.fca-card__date, .fcsr-card__date { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--fxd-text-muted); }
.fcsr-card__date { gap: 3px; font-size: 10px; }
.fca-card__date svg { flex-shrink: 0; }

.fca-card__title, .fcsr-card__title {
	font-size: 14px; font-weight: 700; color: var(--fxd-text); line-height: 1.4; margin: 0;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fcsr-card__title { font-size: 13px; }
.fca-card__title a, .fcsr-card__title a { color: inherit; text-decoration: none; }
.fca-card__title a:hover, .fcsr-card__title a:hover { color: var(--fxd-primary); }

.fca-card__excerpt, .fcsr-card__excerpt {
	font-size: 12px; color: var(--fxd-text-muted); line-height: 1.6; margin: 0;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fcsr-card__excerpt { font-size: 11px; }

.fca-card__facts, .fcsr-card__facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.fcsr-card__facts { gap: 5px; }
.fca-fact { display: flex; flex-direction: column; background: var(--fxd-surface-alt); border: 1px solid var(--fxd-border); border-radius: 5px; padding: 5px 10px; }
.fca-fact__val { font-size: 9px; font-weight: 700; color: var(--fxd-text); line-height: 1.4; }

.fca-card__footer, .fcsr-card__footer { display: flex; align-items: center; gap: 12px; margin-top: 4px; padding-top: 0; }
.fcsr-card__footer { gap: 10px; }

.fca-learn-btn {
	display: inline-flex; align-items: center; color: var(--fxd-primary);
	font-size: 11px; font-weight: 800; border-bottom: 1px solid var(--fxd-primary);
	border-radius: 0; text-decoration: none; letter-spacing: 0.2px; white-space: nowrap;
	transition: color 0.15s;
}
.fca-learn-btn:hover { color: var(--fxd-primary-hover); }

.fca-details-link {
	font-size: 11px; color: var(--fxd-text-muted); text-decoration: none;
	border-bottom: 1px solid var(--fxd-border); padding-bottom: 1px;
	transition: color 0.15s, border-color 0.15s;
}
.fca-details-link:hover { color: var(--fxd-primary); border-color: var(--fxd-primary); }

/* ── Pagination ── */
.fca-pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 28px; }
.fca-page-item a, .fca-page-item span {
	display: flex; align-items: center; justify-content: center;
	min-width: 34px; height: 34px; padding: 0 10px; border-radius: 5px;
	border: 1px solid var(--fxd-border); background: var(--fxd-surface);
	color: var(--fxd-text-muted); font-size: 12px; font-weight: 600;
	text-decoration: none; transition: border-color 0.15s, color 0.15s;
}
.fca-page-item a:hover { border-color: var(--fxd-primary); color: var(--fxd-primary); }
.fca-page-item .current {
	background: var(--fxd-primary);
	color: var(--fxd-surface);
	border-color: var(--fxd-primary);
	font-weight: 800;
}

.fca-no-posts, .fcsr-no-results { color: var(--fxd-text-muted); font-size: 13px; }
.fcsr-no-results { padding: 20px 0; }
.fcsr-no-results strong, .fcsr-meta strong { color: var(--fxd-text); font-weight: 700; }
.fcsr-meta { font-size: 12px; color: var(--fxd-text-muted); margin: 8px 0 0; }

@media (max-width: 540px) {
	.fca-card { flex-direction: column; }
	.fca-card__thumb { width: 100%; min-width: unset; height: 160px; }
	.fca-card__title { font-size: 13px; }
}

/* ── Search bar ── */
.fcsr-search-bar { margin-bottom: 20px; }
.fcsr-form { display: flex; gap: 0; border: 1px solid var(--fxd-border); border-radius: 7px; overflow: hidden; background: var(--fxd-surface); }
.fcsr-input { flex: 1; background: transparent; border: none; outline: none; color: var(--fxd-text); font-size: 13px; padding: 10px 14px; font-family: inherit; }
.fcsr-input::placeholder { color: var(--fxd-text-muted); }
.fcsr-submit { background: var(--fxd-primary); border: none; color: var(--fxd-surface); padding: 0 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.fcsr-submit:hover { background: var(--fxd-primary-hover); }

/* ── Search results grid ── */
.fcsr-grid { display: grid; gap: 14px; }
.fcsr-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.fcsr-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.fcsr-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

.fcsr-card { display: flex; flex-direction: column; background: var(--fxd-surface); border: 1px solid var(--fxd-border); border-radius: 10px; overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s; }
.fcsr-card:hover { border-color: var(--fxd-primary); box-shadow: 0 2px 16px rgba(0,0,0,.08); }
.fcsr-card__thumb { width: 100%; height: 150px; background: var(--fxd-surface-alt); overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fcsr-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fcsr-card__thumb > a { display: block; width: 100%; height: 100%; }
.fcsr-card__thumb-placeholder { color: var(--fxd-border); display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.fcsr-card__body { flex: 1; display: flex; flex-direction: column; gap: 7px; padding: 12px 14px; }
.fcsr-card__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

@media (max-width: 700px) {
	.fcsr-grid--cols-2, .fcsr-grid--cols-3, .fcsr-grid--cols-4 { grid-template-columns: 1fr; }
}
@media (min-width: 701px) and (max-width: 900px) {
	.fcsr-grid--cols-3, .fcsr-grid--cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 901px) and (max-width: 1100px) {
	.fcsr-grid--cols-4 { grid-template-columns: repeat(3, 1fr); }
}
