/*
 * Bennelongia Reports page — hero + year-grouped accordion of `publication`
 * CPT posts with a left timeline rail (see template-parts/reports/ and
 * template-parts/cards/report-accordion.php). The timeline is pure CSS
 * (::before pseudo-elements) rather than new markup, so the existing
 * PHP/HTML structure and accordion behaviour (native <details>) are
 * untouched.
 */

.reports-hero,
.reports-list-section {
	--rp-font: "Sora", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--rp-ink: #1B250E;
	--rp-heading: #030712;
	--rp-body: #364153;
	--rp-muted: #6A7282;
	--rp-green: #7FB04F;
	--rp-orange: #EF8F48;
	--rp-bg: #F7F7F8;
	--rp-border: #F1F1F3;
	--rp-max-width: 1560px;
}

/* =============================================================================
   Hero
   ============================================================================= */

.reports-hero {
	position: relative;
	max-width: 1880px;
	height: 400px;
	margin: 0 auto;
	border-radius: 20px;
	overflow: hidden;
	background-color: #1B250E;
	background-size: cover;
	background-position: center;
	display: flex;
	align-items: center;
}

.reports-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.45) 100%);
}

.reports-hero__inner {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: var(--rp-max-width);
	margin: 0 auto;
	padding: 0 40px;
}

.reports-hero__title {
	margin: 0;
	font-family: var(--rp-font);
	font-size: 52px;
	font-weight: 600;
	line-height: 60px;
	color: #FFFFFF;
}

/* =============================================================================
   Reports list — outer layout + timeline rail
   ============================================================================= */

.reports-list-section {
	padding: 100px 0;
}

.reports-list-section__inner {
	max-width: var(--rp-max-width);
	margin: 0 auto;
	padding: 0 24px;
}

.reports-list-section__empty {
	font-family: var(--rp-font);
	color: var(--rp-body);
}

.reports-list {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 30px;
	padding-left: 72px;
}

/*
 * Timeline geometry — the rail sits ~42px from .reports-list's own left
 * edge; each dot marker (a child of .report-accordion, whose own left edge
 * starts at the padding-left gutter) is offset back to that same x so its
 * centre lands exactly on the line, for every row and through the gaps
 * between accordions (the rail is a single pseudo-element on the flex
 * container itself, running the full list height, so it never breaks when
 * an accordion's expanded content changes the list's overall height).
 */
.reports-list {
	--rp-timeline-x: 42px;
}

/* The timeline rail — flat #EF8F48 @ ~10% opacity, continuous top-to-bottom
   through every accordion and every gap between them. */
.reports-list::before {
	content: "";
	position: absolute;
	left: var(--rp-timeline-x);
	top: 26px;
	bottom: 26px;
	width: 5px;
	transform: translateX(-50%);
	background-color: rgba(239, 143, 72, 0.1);
	border-radius: 3px;
}

/* One marker per year row, vertically centred on that row's 52px header. */
.report-accordion {
	position: relative;
}

/* Outer 16px ring, centred on the rail. */
.report-accordion::before {
	content: "";
	position: absolute;
	box-sizing: border-box;
	left: calc(var(--rp-timeline-x) - 72px);
	top: 26px;
	width: 16px;
	height: 16px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: #FFFFFF;
	border: 2px solid rgba(239, 143, 72, 0.3);
	z-index: 1;
}

/* The open/"current" (always the first) row's marker gets a solid, smaller
   orange centre dot inside the ring, reading as the active point on the
   timeline. */
.report-accordion[open]::before,
.report-accordion:first-of-type::before {
	border-color: rgba(239, 143, 72, 0.6);
}

.report-accordion[open]::after,
.report-accordion:first-of-type::after {
	content: "";
	position: absolute;
	left: calc(var(--rp-timeline-x) - 72px);
	top: 26px;
	width: 8px;
	height: 8px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: var(--rp-orange);
	z-index: 2;
}

/* --- One year group --- */

.report-accordion {
	background: var(--rp-bg);
	border: 1px solid var(--rp-border);
	border-radius: 20px;
	padding: 30px;
}

.report-accordion__summary {
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	height: 52px;
	cursor: pointer;
	font-family: var(--rp-font);
	user-select: none;
}

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

.report-accordion__icon-box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	border-radius: 12px;
	background: #FFFFFF;
}

.report-accordion__icon-box img {
	display: block;
	width: 24px;
	height: 24px;
	object-fit: contain;
}

.report-accordion__title {
	flex: 1 1 auto;
	font-size: 28px;
	font-weight: 600;
	line-height: 38px;
	color: var(--rp-heading);
}

.report-accordion__toggle-box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	border-radius: 12px;
	border: 1px solid var(--rp-green);
	color: var(--rp-green);
}

.report-accordion__chevron {
	transition: transform .2s ease;
}

.report-accordion[open] .report-accordion__chevron {
	transform: rotate(180deg);
}

.report-accordion__body {
	background: #FFFFFF;
	border-radius: 20px;
	padding: 30px;
	margin-top: 30px;
}

.report-accordion__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 695px));
	gap: 24px 30px;
}

.report-accordion__item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.report-accordion__item-icon {
	display: inline-flex;
	flex-shrink: 0;
	width: 24px;
	height: 24px;
}

.report-accordion__item-icon img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.report-accordion__item-text {
	font-family: var(--rp-font);
	font-size: 18px;
	line-height: 24px;
	color: var(--rp-body);
}

.report-accordion__item-title {
	font-weight: 500;
	color: var(--rp-heading);
}

.report-accordion__item-desc {
	font-weight: 400;
	color: var(--rp-muted);
}

/* The trailing "View Report" link — inline, not the whole row (most
   reports have no PDF at all, and those intentionally render with no
   link). */
.report-accordion__link {
	display: inline;
	margin-left: 4px;
	color: var(--rp-green);
	font-weight: 500;
	text-decoration: none;
}

.report-accordion__link:hover,
.report-accordion__link:focus-visible {
	color: #5f8f3a;
	outline: none;
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 1400px) {
	.reports-hero {
		height: 320px;
	}

	.reports-hero__title {
		font-size: 40px;
		line-height: 48px;
	}

	.report-accordion__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 1024px) {
	.reports-list-section {
		padding: 60px 0;
	}

	.reports-hero {
		height: 260px;
		border-radius: 16px;
		margin-left: 24px;
		margin-right: 24px;
	}

	.reports-hero__title {
		font-size: 32px;
		line-height: 40px;
	}

	.reports-list {
		--rp-timeline-x: 32px;
		padding-left: 56px;
	}

	.report-accordion::before {
		left: calc(var(--rp-timeline-x) - 56px);
		width: 14px;
		height: 14px;
	}

	.report-accordion[open]::after,
	.report-accordion:first-of-type::after {
		left: calc(var(--rp-timeline-x) - 56px);
		width: 7px;
		height: 7px;
	}

	.report-accordion {
		padding: 20px;
	}

	.report-accordion__title {
		font-size: 22px;
		line-height: 30px;
	}

	.report-accordion__icon-box,
	.report-accordion__toggle-box {
		width: 44px;
		height: 44px;
	}

	.report-accordion__body {
		padding: 20px;
	}

	.report-accordion__list {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.reports-hero {
		margin-left: 16px;
		margin-right: 16px;
		height: 200px;
		border-radius: 12px;
	}

	.reports-hero__inner {
		padding: 0 20px;
	}

	.reports-hero__title {
		font-size: 26px;
		line-height: 32px;
	}

	.reports-list-section {
		padding: 40px 0;
	}

	.reports-list-section__inner {
		padding: 0 16px;
	}

	.reports-list {
		--rp-timeline-x: 20px;
		padding-left: 40px;
		gap: 20px;
	}

	.report-accordion::before {
		left: calc(var(--rp-timeline-x) - 40px);
		width: 12px;
		height: 12px;
	}

	.report-accordion[open]::after,
	.report-accordion:first-of-type::after {
		left: calc(var(--rp-timeline-x) - 40px);
		width: 6px;
		height: 6px;
	}

	.report-accordion {
		padding: 16px;
		border-radius: 14px;
	}

	.report-accordion__summary {
		height: auto;
		min-height: 44px;
	}

	.report-accordion__title {
		font-size: 18px;
		line-height: 26px;
	}

	.report-accordion__icon-box,
	.report-accordion__toggle-box {
		width: 36px;
		height: 36px;
		border-radius: 10px;
	}

	.report-accordion__body {
		padding: 16px;
		border-radius: 14px;
	}

	.report-accordion__item-text {
		font-size: 16px;
		line-height: 22px;
	}
}
