/* Hansard Detail Page Styles */

/* Smooth scroll for anchor navigation */
html {
	scroll-behavior: smooth;
}

.site-content {
	display: flex;
	justify-content: center;
}

.hansard-container {
	margin: 0 auto;
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	max-width: 1280px;
	padding: 1rem;
}

/* Header Section */
.hansard-header {
	display: flex;
	padding: 1rem;
	border-radius: 6px;
	justify-content: center;
	margin-bottom: 0;
	flex-wrap: wrap;
}

.hansard-header h1 {
	flex: 0 1 100%;
	text-align: center;
	margin-bottom: 1rem;
}

.hansard-meta {
	display: flex;
	gap: 1rem;
	margin: 1rem 0;
	justify-content: space-between;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 0.5rem;
}

.head-metadata {
	display: flex;
	flex-wrap: wrap;
	height: auto;
}

.hansard-meta span {
	height: 2.4rem;
}

.hansard-meta p,
.hansard-meta span {
	padding: 0;
	border-radius: 5px;
	font-size: 0.9rem;
	margin: 0.2rem 0;
	flex: 0 1 100%;
}

/* Document Thumbnail */
.document-thumbnail {
	max-width: 8rem;
}

.document-thumbnail img {
	width: 100%;
	height: auto;
	border-radius: 5px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

p.view-doc {
	font-size: 0.8rem;
	font-weight: 600;
	text-align: center;
	margin: 0;
}

.doc-summary h3 {
	margin-top: 0;
	color: var(--colour-secondary-dark);
}

.sentiment-data {
	font-weight: 500;
}

h4.doc-sentiment {
	margin-top: 0.5rem;
	color: var(--colour-secondary-dark);
}

hr {
	border-top: 1px solid #ddd;
	margin: 2rem 0;
}

span.chair-name {
	padding: 0;
	margin: 0;
	font-weight: 600;
}

.header-section {
	display: flex;
	flex: 0 1 100%;
	justify-content: center;
	font-size: 1.6rem;
	font-weight: 700;
	margin: 0.5rem 0;
}

.member-names {
	display: flex;
	justify-content: left;
	margin-left: 10vw;
	flex-wrap: wrap;
	flex: 0 1 100%;
}

.member-names li {
	flex: 0 1 100%;
}

.chamber-action {
	font-style: italic;
	margin: 1rem;
}

/* Scene Descriptions and Procedural Notes */
aside.scene-description,
aside.procedural-note {
	font-style: italic;
	color: #495057;
	padding: 0.25rem 0.5rem;
	margin: 0.25rem 0;
	font-size: 0.9rem;
}

/* Main document headers */
.header-main {
	display: flex;
	flex: 0 1 100%;
	justify-content: center;
	font-size: 2rem;
	font-weight: 800;
	margin: 1rem 0;
	color: var(--colour-primary);
}

/* Major section headers */
h1.main-header {
	flex: 0 1 100%;
	justify-content: center;
	display: flex;
	text-align: center;
	font-size: 1.6rem;
	font-weight: 700;
	margin: 0.5rem 0;
	color: var(--colour-primary);
}

h2.major-section-header {
	display: flex;
	flex: 0 1 100%;
	justify-content: center;
	font-size: 1.6rem;
	font-weight: 700;
	margin: 1rem 0 0;
	color: var(--colour-primary-dark);
	padding-bottom: 0.5rem;
}

h2.header-section {
	display: flex;
	justify-content: center;
	font-size: 1.2rem;
	line-height: 1.6rem;
	font-weight: bold;
	width: 60%;
	margin: 0 auto 0.5rem;
	text-align: center;
}

/* Subsection headers */
.header-subsection {
	display: flex;
	flex: 0 1 100%;
	justify-content: center;
	font-size: 1.4rem;
	font-weight: 650;
	margin: 0.75rem 0;
	color: #555;
}

/* Speaker line containers */
.speaker-line {
	flex: 0 1 100%;
	font-weight: 700;
	margin: 0.5rem 0;
	padding: 0.25rem 0;
}

/* General body text */
.body-text {
	flex: 0 1 100%;
	font-size: 1rem;
	line-height: 1.6;
	margin: 0.5rem 0;
}

/* Document metadata */
.metadata,
.procedural-note {
	flex: 0 1 100%;
	font-size: 0.9rem;
	font-style: italic;
	font-weight: 600;
	text-align: center;
	margin: 0 0 1rem;
	padding: 0.5rem;
	border-radius: 3px;
}

/* List elements */
.list-label {
	font-weight: 600;
	margin: 0.5rem 0 0.25rem 0;
}

.list-item {
	margin: 0.25rem 0;
	padding-left: 1rem;
}

/* Table elements */
.table-header {
	font-weight: bold;
	background-color: #e8f4f8;
	padding: 0.5rem;
	border: 1px solid #000;
}

.table-row {
	border: 1px solid #000;
}

.table-row td {
	padding: 0.5rem;
	border: 1px solid #000;
}

.document-actions a {
	color: var(--colour-primary);
	background: white;
	border: 1px solid var(--colour-primary);
}

/* Procedural Notes - Enhanced styles from existing */
aside.procedural-note {
	display: flex;
	justify-content: center;
	margin: 10px 0;
	padding: 8px 12px;
	font-size: 0.9rem;
	font-style: italic;
	padding: 0.25rem 0.5rem;
	margin: 0.25rem 0;
}

/* Scene Descriptions */
aside.scene-description {
	display: flex;
	justify-content: center;
	font-style: italic;
	font-size: 10pt;
	font-weight: 600;
	padding: 0.5rem;
	margin: 0.5rem 0;
	border-radius: var(--border-radius);
	font-size: 0.95rem;
}

/* Page End details */
div.page-break {
	flex: 0 1 100%;
	border-top: 1px solid black;
	margin: 2rem 0;
	font-weight: 600;
	text-align: center;
	padding: 0.25rem 0 0;
}

div.page-break div.date-line {
	font-size: 0.75rem;
	text-transform: uppercase;
	text-align: left;
	color: var(--colour-secondary);
}

div.page-break:nth-child(1) {
	display: none;
}

span.page-number {
	float: right;
	font-weight: 700;
}

/* Speaker Announcements */
p.speaker-announcement {
	margin: 15px 0;
	font-size: 11pt;
}

p.speaker-announcement strong {
	color: #2c3e50;
	font-weight: bold;
}

/* Lists */
ul.content-list,
ol.content-list {
	margin: 15px 0;
	padding-left: 40px;
}

ul.content-list li,
ol.content-list li {
	margin: 8px 0;
	font-size: 11pt;
}

/* Tables */
table.hansard-table {
	width: 70%;
	display: table;
	margin: 1.5rem auto;
	border-collapse: collapse;
	font-size: 0.8rem;
}

table.hansard-table th {
	background: var(--colour-primary-alpha-80);
	color: white;
	padding: 10px;
	text-align: left;
	font-weight: bold;
	flex: 0 1 100%;
	border: 1px solid #000;
	padding: 8px 12px;
	text-align: left;
	font-weight: bold;
}

table.hansard-table td {
	font-weight: 600;
	padding: 8px 10px;
	border: 1px solid #888;
}

table.hansard-table tbody tr:nth-child(even) {
	background: #f8f9fa;
}

/* Content Section */
.hansard-content {
	line-height: 1.8;
	max-width: 100%;
}

.speech-content {
	flex: 0 1 100%;
	font-size: 1rem;
	margin: 0.5rem 0;
}

.speech-content p {
	margin: 0;
}

.speaker-speech {
	flex: 0 1 100%;
	padding: 0.5rem 0;
}

.speaker-name {
	font-weight: 700;
	flex: 1 1 100%;
}

.speaker-name a {
	color: var(--colour-primary);
	text-decoration: none;
}

.speaker-name a:hover {
	color: var(--colour-secondary);
	text-decoration: none;
}

.order-content {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	margin: 0 0 1rem;
}

.order-content h2 {
	flex: 0 1 100%;
	margin: 0.25rem 0;
}

.section-detail,
.order-detail {
	flex: 0 1 100%;
	display: flex;
	justify-content: center;
	font-weight: 600;
	font-size: 1.2rem;
	margin: 0.25rem;
}

.order-header,
.section-detail {
	text-align: center;
}

ol.numbered-list {
	flex: 0 1 90%;
	font-size: 1rem;
}

.content-chunk {
	margin-bottom: 2rem;
	padding: 1.5rem;
	background: #fff;
	border: 1px solid #eee;
	border-radius: 6px;
}

.content-chunk.highlighted {
	background: #d4efd5;
}

.hansard-sources-grid {
	display: flex;
	flex-wrap: wrap;
}

.hansard-source-card {
	padding: 1rem 1rem 0;
	border-radius: 0.5rem;
	margin: 0.5rem 0;
	border: 2px solid var(--colour-secondary-alpha-20);
}

.source-content {
	background: #fff;
	padding: 0 1rem;
	border-radius: 0.5rem;
	border: 1px solid #f8f9fa;
}

.view-document-link {
	font-weight: 600;
	font-style: italic;
	color: var(--colour-secondary-alpha-80);
}

/* Chunk anchor target highlighting - when navigating via #chunk-{id} */
.chunk-wrapper:target {
	background: #d4efd5;
	padding: 0.5rem;
	border-radius: 6px;
	animation: highlightFade 2s ease-in-out;
	scroll-margin-top: 100px;
	/* Offset for fixed headers */
}

@keyframes highlightFade {
	0% {
		background: #b6efb8;
		box-shadow: 0 0 20px rgba(182, 239, 184, 0.3);
	}

	100% {
		background: #d4efd5;
		box-shadow: none;
	}
}

.chunk-meta {
	font-size: 0.8rem;
	color: #999;
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid #f0f0f0;
}

/* Action Buttons */
.document-actions {
	margin: 2rem 0;
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
}

.btn {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	text-decoration: none;
	border-radius: 5px;
	font-weight: 500;
	transition: all 0.3s ease;
	border: none;
	cursor: pointer;
}

.btn-primary {
	background: var(--colour-primary);
	color: white;
}

.btn-primary:hover {
	background: var(--colour-primary);
	transform: translateY(-1px);
}

.btn-secondary {
	background: #6c757d;
	color: white;
}

.btn-secondary:hover {
	background: #545b62;
	transform: translateY(-1px);
}

/* Search and Navigation */
.search-highlight {
	background: #ffeb3b;
	padding: 0.1rem 0.2rem;
	border-radius: 2px;
	font-weight: 500;
}

.back-to-search {
	margin-bottom: 1rem;
}

.back-to-search a {
	color: var(--colour-primary);
	text-decoration: none;
	font-weight: 500;
}

.back-to-search a:hover {
	text-decoration: underline;
}

.search-info {
	background: #fff3e0;
	padding: 1rem;
	border-radius: 5px;
	margin-bottom: 2rem;
	border-left: 5px solid #ff9800;
}

/* Contributors Section */
.contributors {
	margin: 1rem 0;
	padding: 1rem 2rem;
	background: #f8f9fa;
	border-radius: 6px;
	border-left: 5px solid var(--colour-primary);
}

.contributors h3 {
	margin-bottom: 1rem;
	color: #333;
}

.contributor-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1rem;
}

.contributor-tag {
	background: #daf7ea;
	color: #009f57;
	padding: 0.4rem 1rem;
	border-radius: 25px;
	font-size: 0.9rem;
	font-weight: 500;
	display: inline-block;
	margin: 0.3rem 0.2rem;
	transition: all 0.3s ease;
	border: 2px solid transparent;
}

.contributor-link {
	text-decoration: none;
	color: inherit;
}

.contributor-link:hover .contributor-tag.linked {
	background: #009f57;
	color: white;
	transform: translateY(-1px);
}

.contributor-link:hover small,
.contributor-tag.linked:hover small {
	color: white;
}

.contributor-role {
	font-size: 0.8em;
	opacity: 0.8;
	font-weight: normal;
	display: block;
	margin-top: 0.2rem;
}

/* No Content State */
.no-content {
	text-align: center;
	padding: 3rem;
	background: #f8f9fa;
	border-radius: 6px;
	color: #666;
	border: 2px dashed #ddd;
}

.no-content p {
	margin: 0.5rem 0;
}

.search-results {
	margin-top: 2rem;
}

.search-result-item {
	border: 1px solid #ddd;
	padding: 1rem;
	margin-bottom: 1rem;
	border-radius: 5px;
	background: #fff;
	transition: box-shadow 0.3s ease;
}

.search-result-item:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-result-meta {
	font-size: 0.9em;
	color: #666;
	margin-bottom: 0.5rem;
}

.search-result-content {
	line-height: 1.6;
}

.hansard-filters {
	background: var(--colour-secondary-alpha-20);
	padding: 1rem;
	margin-bottom: 2rem;
	border-radius: 5px;
}

.hansard-filters h3 {
	color: var(--colour-primary-dark);
	margin: 0.25rem 0;
}

/* Hansard List Page Styles */

.hansard-documents {
	display: flex;
	justify-content: space-between;
	flex-wrap: nowrap;
	gap: 1rem;
}

h3.split-header,
h3.advanced-filters {
	color: var(--colour-primary-dark);
	margin-top: 0.25rem;
}

.hansard-document {
	padding: 0.25rem;
	margin-bottom: 1rem;
}

.hansard-document h3 {
	margin: 0;
	font-size: 1rem;
}

.hansard-document h3 a {
	color: var(--colour-primary);
	border-bottom: 2px solid var(--colour-primary);
}

.hansard-document h3 a:hover {
	color: var(--colour-secondary);
	border-bottom: 2px solid var(--colour-secondary);
}

.loading {
	display: none;
	text-align: center;
	padding: 2rem;
	color: #666;
}

.search-type-toggle {
	margin: 1rem 0;
}

.search-type-toggle label {
	margin-right: 1rem;
	font-weight: normal;
	cursor: pointer;
	font-weight: bold;
	color: var(--colour-primary-dark);
}

.search-type-toggle label:hover {
	color: var(--colour-secondary-dark);
}

.search-type-toggle input[type="radio"] {
	margin-right: 0.5rem;
	accent-color: var(--colour-primary);
}

.search-type-toggle input[type="radio"]:hover {
	accent-color: var(--colour-secondary);
}

/* Filter Form Styles */
.filter-form {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: end;
}

.filter-grid {
	display: flex;
	justify-content: space-evenly;
}

.filter-group {
	display: flex;
	flex-direction: column;
	min-width: 150px;
	flex: 0 1 50%;
	margin: 0 1rem 2rem;
}

.filter-group label {
	margin-bottom: 0.3rem;
	font-weight: 500;
	color: #333;
}

.filter-group input,
.filter-group select {
	padding: 0.5rem;
	border: 1px solid #f88;
	border-radius: 5px;
	background-color: var(--colour-primary-alpha-20);
}

.filter-form button {
	padding: 0.5rem 1rem;
	background: var(--colour-primary);
	color: white;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	font-weight: 500;
}

.filter-form button:hover {
	background: var(--colour-secondary);
}

section.ai-answer-section {
	border-radius: 0.5rem;
	padding: 0 1.5rem;
	margin-bottom: 2rem;
}

.ai-answer {
	background: white;
	padding: 0 1rem 1rem;
	border-radius: 4px;
	border-left: 4px solid #009f57;
}

.ai-answer-header {
	padding: 0.5rem 0;
	color: var(--colour-secondary-dark);
}

.ai-answer-results {
	padding: 0.5rem 0 0 1rem;
	color: var(--colour-secondary-dark);
}

/* Search Form Styles */
section.hansard-search {
	margin-bottom: 0rem;
}

.hansard-transcripts--text {
	margin-bottom: 0;
}

.search-input-group {
	display: flex;
	margin-bottom: 0.5rem;
}

.search-input-group input {
	flex: 1;
	padding: 0.75rem;
	border: 1px solid #bbb;
	border-radius: 5px 0 0 5px;
	font-size: 1rem;
}

/* Pagination */
.pagination {
	margin-top: 2rem;
	text-align: center;
}

.pagination-info {
	margin-bottom: 1rem;
	color: #666;
}

.pagination-links {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.pagination-links a,
.pagination-links .current-page {
	padding: 0.5rem 0.75rem;
	border: 1px solid #ddd;
	border-radius: 5px;
	text-decoration: none;
	color: #333;
}

.pagination-links a:hover {
	background: #f0f8ff;
	border-color: var(--colour-primary);
}

.pagination-links .current-page {
	background: var(--colour-primary);
	color: white;
	border-color: var(--colour-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
	.hansard-meta {
		flex-direction: column;
		gap: 0.5rem;
	}

	.document-actions {
		flex-direction: column;
	}

	.document-thumbnail {
		float: none;
		margin: 1rem auto;
		max-width: 150px;
		text-align: center;
	}

	.filter-form {
		flex-direction: column;
		align-items: stretch;
	}

	.filter-group {
		min-width: auto;
	}

	.search-input-group {
		flex-direction: column;
	}

	.search-input-group input {
		border: 1px solid #ddd;
		border-radius: 5px;
		margin-bottom: 0.5rem;
	}

	.search-input-group button {
		border-radius: 5px;
	}

	.contributor-list {
		justify-content: center;
	}

	.document-meta {
		flex-direction: column;
		gap: 0.5rem;
	}

	.pagination-links {
		justify-content: center;
	}
}

/* Additional Vectorizer-Aligned CSS Classes */

/* Main document headers */
.header-main {
	display: flex;
	flex: 0 1 100%;
	justify-content: center;
	font-size: 2rem;
	font-weight: 800;
	margin: 1rem 0;
	color: var(--colour-primary);
}

/* Major section headers */

/* Print Styles */
@media print {
	.document-actions,
	.back-to-search,
	.search-info {
		display: none;
	}

	.hansard-header {
		border-left: none;
		background: white;
		padding: 1rem 0;
	}

	.content-chunk {
		border: none;
		box-shadow: none;
		padding: 0.5rem 0;
	}

	.hansard-document {
		padding: 20px;
	}

	div.page-break {
		page-break-after: always;
		border: none;
		background: none;
	}
}
