/*
 * Interactivity for the report-section blocks. Keyframes and timing tokens
 * come from assets/ai-animations.css (a dependency of this stylesheet). Uses the theme's own
 * Bootstrap CSS variables (matching key-takeaways.css's approach) so this
 * respects light/dark mode automatically. Everything below is additive —
 * every section is already correct/visible without JS; this only adds the
 * reveal choreography on top.
 */

.adw-report-section {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity var(--adw-ai-duration-slow) var(--adw-ai-ease-out), transform var(--adw-ai-duration-slow) var(--adw-ai-ease-out);
}

.adw-report-section.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* ── Hero: dark masthead with drifting glow, faint grid, display headline ── */

.adw-report-hero {
	position: relative;
	overflow: hidden;
	max-width: 1080px;
	margin: 0 auto;
	padding: clamp(2.75rem, 6vw, 5rem) clamp(1.5rem, 5vw, 4rem) clamp(2.5rem, 5vw, 4rem);
	border-radius: 0 2.5rem 0 2.5rem; /* the site's cut-corner shape */
	background: #0d0d12;
	color: #fff;
	isolation: isolate;
}

.adw-report-hero__glow {
	position: absolute;
	inset: -40%;
	z-index: -2;
	background:
		radial-gradient(38% 42% at 72% 28%, rgba(245, 60, 96, 0.55), transparent 70%),
		radial-gradient(30% 36% at 18% 78%, rgba(154, 145, 201, 0.42), transparent 70%),
		radial-gradient(26% 30% at 92% 88%, rgba(255, 179, 71, 0.22), transparent 70%);
	filter: blur(10px);
	animation: adw-report-hero-drift 18s ease-in-out infinite alternate;
}

.adw-report-hero__grid {
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
	background-size: 48px 48px;
	-webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 70%);
	mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 70%);
}

@keyframes adw-report-hero-drift {
	0% { transform: translate3d(0, 0, 0) rotate(0deg); }
	100% { transform: translate3d(-6%, 4%, 0) rotate(8deg); }
}

.adw-report-hero__inner {
	position: relative;
	max-width: 52rem;
}

.adw-report-hero__brand {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	margin: 0 0 1.75rem;
	color: #fff;
	line-height: 1;
}

.adw-report-hero__logo {
	display: block;
	width: auto;
	height: 1.75rem;
}

.adw-report-hero__divider {
	width: 1px;
	height: 1.5rem;
	background: rgba(255, 255, 255, 0.35);
}

.adw-report-hero__product {
	color: rgba(255, 255, 255, 0.9);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.28em;
	text-transform: uppercase;
}

.adw-report-hero__eyebrow {
	margin: 0 0 0.75rem;
	color: #ff758c;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
}

.adw-report-hero__title {
	margin: 0;
	color: #fff;
	font-family: "Resolve Sans Compressed Italic", "Resolve Fallback", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: clamp(2.6rem, 6.5vw, 5.25rem);
	font-weight: 600;
	line-height: 0.95;
	letter-spacing: 0.01em;
	word-spacing: 0.12em; /* the compressed face nearly closes the gaps between words */
	text-transform: uppercase;
	text-wrap: balance;
}

.adw-report-hero__dek {
	max-width: 44rem;
	margin: 1.5rem 0 0;
	color: rgba(255, 255, 255, 0.78);
	font-size: clamp(1.02rem, 1.6vw, 1.2rem);
	line-height: 1.6;
}

.adw-report-hero__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem 2.5rem;
	margin: 2.25rem 0 0;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.adw-report-hero__meta-item dt {
	margin: 0 0 0.3rem;
	color: rgba(255, 255, 255, 0.55);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.adw-report-hero__meta-item dd {
	margin: 0;
	color: #fff;
	font-size: 1.05rem;
	font-weight: 600;
}

/* ── The AI-generated eyebrow's sparkle — same motif as the Key Takeaways badge ── */

.adw-report-eyebrow__sparkle {
	display: inline-block;
	width: 0.5em;
	height: 0.5em;
	margin-right: 0.5em;
	border-radius: 2px;
	background: var(--bs-primary, #f53c60);
	transform: rotate(45deg);
	animation: adw-ai-diamond-pulse 1.6s ease-in-out infinite;
}

/* ── Staggered reveal for individual items within a section (stat tiles, cards, timeline events, accordion rows) ── */

.adw-report-reveal {
	animation: adw-ai-fade-up var(--adw-ai-duration-slow) var(--adw-ai-ease-out) both;
}

/* ── Stat tiles ── */

.adw-report-stat {
	transition: transform var(--adw-ai-duration-fast) ease, box-shadow var(--adw-ai-duration-fast) ease;
}

.adw-report-stat:hover {
	transform: translateY(-3px);
	box-shadow: var(--bs-box-shadow, 0 0.5rem 1rem rgba(0, 0, 0, 0.1));
}

/* ── Cards (trend / companies / what's-next) ── */

.adw-report-card {
	transition: transform var(--adw-ai-duration-fast) ease, box-shadow var(--adw-ai-duration-fast) ease, border-color var(--adw-ai-duration-fast) ease;
}

.adw-report-card:hover {
	transform: translateY(-3px);
	border-color: var(--bs-primary, #f53c60);
	box-shadow: var(--bs-box-shadow, 0 0.5rem 1rem rgba(0, 0, 0, 0.1));
}

/* ── Developments accordion ── */

.adw-report-details__summary {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.adw-report-details__summary::-webkit-details-marker {
	display: none;
}

.adw-report-details__chevron {
	display: inline-block;
	color: var(--bs-primary, #f53c60);
	transition: transform var(--adw-ai-duration-fast) ease;
	flex: none;
}

.adw-report-details[open] > .adw-report-details__summary .adw-report-details__chevron {
	transform: rotate(90deg);
}

.adw-report-details__body {
	overflow: hidden;
	transition: height var(--adw-ai-duration-fast) ease;
	padding-top: 0.6rem;
}

/* ── Timeline: connecting line + dots ── */

.adw-report-timeline {
	border-left: 2px solid var(--bs-border-color, #dee2e6);
	margin-left: 0.4rem;
}

.adw-report-timeline__item {
	margin-left: -2px;
}

.adw-report-timeline__dot {
	position: absolute;
	left: -0.4rem;
	top: 0.15rem;
	width: 0.7rem;
	height: 0.7rem;
	border-radius: 50%;
	background: var(--bs-primary, #f53c60);
	border: 2px solid var(--bs-body-bg, #fff);
	box-shadow: 0 0 0 2px var(--bs-primary, #f53c60);
	transform: scale(0);
	transition: transform var(--adw-ai-duration-base) var(--adw-ai-ease-out);
}

.adw-report-timeline__item.adw-report-reveal .adw-report-timeline__dot {
	transform: scale(1);
}

/* ── Stat ring gauges (percentage stats) — fill once the section is revealed ── */

.adw-report-stat__figure {
	position: relative;
	width: 6.5rem;
	height: 6.5rem;
	display: grid;
	place-items: center;
}

.adw-report-stat__figure .adw-report-stat__value {
	position: relative;
	font-size: 1.45rem !important;
}

.adw-report-ring {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.adw-report-ring circle {
	fill: none;
	stroke-width: 3.2;
}

.adw-report-ring__track {
	stroke: var(--bs-secondary-bg, #e9ecef);
}

.adw-report-ring__fill {
	stroke: var(--bs-primary, #f53c60);
	stroke-linecap: round;
	stroke-dasharray: 100;
	stroke-dashoffset: 100;
	transition: stroke-dashoffset 1.1s var(--adw-ai-ease-out);
}

.adw-report-section.is-visible .adw-report-ring__fill {
	stroke-dashoffset: calc(100 - var(--adw-ring, 0));
}

/* ── Bar chart: bars grow from zero once the section is revealed ── */

.adw-report-chart {
	display: grid;
	gap: 0.7rem;
	margin-top: 1.25rem;
}

.adw-report-chart__row {
	display: grid;
	grid-template-columns: minmax(7rem, 32%) 1fr 4.5rem;
	align-items: center;
	gap: 0.75rem;
}

.adw-report-chart__label {
	font-size: 0.9rem;
	font-weight: 600;
}

.adw-report-chart__track {
	display: block;
	height: 1.1rem;
	border-radius: 0 999px 999px 0;
	background: var(--bs-secondary-bg, #e9ecef);
	overflow: hidden;
}

.adw-report-chart__bar {
	display: block;
	height: 100%;
	width: 0;
	border-radius: inherit;
	background: linear-gradient(90deg, #b5003b, var(--bs-primary, #f53c60) 60%, #ff758c);
	transition: width 1.1s var(--adw-ai-ease-out);
	transition-delay: calc(var(--adw-bar-index, 0) * 110ms);
}

.adw-report-section.is-visible .adw-report-chart__bar {
	width: var(--adw-bar-width, 0%);
}

.adw-report-chart__value {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--bs-primary, #f53c60);
	text-align: right;
}

@media (max-width: 575.98px) {
	.adw-report-chart__row {
		grid-template-columns: 1fr 4rem;
	}
	.adw-report-chart__track {
		grid-column: 1 / -1;
		grid-row: 2;
	}
}

/* ── Footnotes: superscript cites jump to the numbered Sources list ── */

.adw-report-cite {
	margin-left: 0.15em;
	font-size: 0.7em;
	font-weight: 700;
	line-height: 0;
	white-space: nowrap;
}

.adw-report-cite a {
	color: var(--bs-primary, #f53c60);
	text-decoration: none;
	padding: 0 0.1em;
}

.adw-report-cite a:hover,
.adw-report-cite a:focus-visible {
	text-decoration: underline;
}

.adw-report-footnote {
	scroll-margin-top: 30vh;
	border-radius: 4px;
}

.adw-report-footnote__tag {
	display: inline-block;
	padding: 0 0.4em;
	border-radius: 3px;
	background: var(--bs-primary, #f53c60);
	color: #fff;
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	vertical-align: 0.15em;
}

.adw-report-footnote.is-targeted,
.adw-report-footnote:target {
	animation: adw-ai-highlight var(--adw-ai-duration-highlight) ease-out;
}

@media (prefers-reduced-motion: reduce) {
	.adw-report-hero__glow {
		animation: none;
	}

	.adw-report-ring__fill {
		stroke-dashoffset: calc(100 - var(--adw-ring, 0));
		transition: none;
	}

	.adw-report-chart__bar {
		width: var(--adw-bar-width, 0%);
		transition: none;
	}

	.adw-report-section {
		transition: none;
		opacity: 1;
		transform: none;
	}

	.adw-report-reveal,
	.adw-report-eyebrow__sparkle {
		animation: none !important;
	}

	.adw-report-timeline__dot {
		transform: scale(1);
	}

	.adw-report-card:hover,
	.adw-report-stat:hover {
		transform: none;
	}
}

/* ── Block editor: previews render fully revealed (the view script doesn't run there) ── */

.editor-styles-wrapper .adw-report-section {
	opacity: 1;
	transform: none;
	transition: none;
}

.editor-styles-wrapper .adw-report-chart__bar {
	width: var(--adw-bar-width, 0%);
	transition: none;
}

.editor-styles-wrapper .adw-report-ring__fill {
	stroke-dashoffset: calc(100 - var(--adw-ring, 0));
	transition: none;
}

.editor-styles-wrapper .adw-report-timeline__dot {
	transform: scale(1);
}

/* Preview is display-only; links inside must not navigate away from the editor. */
.adw-report-preview {
	cursor: pointer;
}

.adw-report-preview > * {
	pointer-events: none;
}

.adw-report-edit-panel.components-placeholder {
	align-items: stretch;
	max-width: 900px;
	margin: 0 auto;
}

.adw-report-edit-panel .components-placeholder__fieldset,
.adw-report-edit-panel__fields {
	display: block;
	width: 100%;
	max-width: none;
}

.adw-report-edit-panel__actions {
	display: flex;
	justify-content: flex-end;
	width: 100%;
	margin-top: 12px;
}

/* Visually hidden label for the logo lockup, in case the theme doesn't define it. */
.adw-report-hero .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
