/* Case Work — evidence grid, cards, and modal viewer. */

/*
 * Divi Theme Builder zeroes #page-container padding when a TB header is active,
 * which lets the fixed header overlap the page title on case pages.
 */
body.cw-case-page.et-tb-has-header #page-container {
	padding-top: 80px;
}

body.admin-bar.cw-case-page.et-tb-has-header #page-container {
	padding-top: 112px;
}

body.cw-case-page #left-area > .entry-title {
	margin-top: 0;
}

/* Hide blog-style author/date line; the case title stays as the page H1. */
body.single-case_work .et_post_meta_wrapper,
body.single-case_work #left-area > .post-meta,
body.single-case_work .entry-meta {
	display: none;
}

/* Case single page layout */
.cw-case-single {
	line-height: 1.65;
}

.cw-case-single__header {
	margin: 0 0 2.5rem;
}

.cw-case-single__meta {
	margin: 0 0 1.25rem;
	line-height: 1.7;
}

.cw-case-single__intro {
	margin: 0 0 1.5rem;
	line-height: 1.65;
}

.cw-case-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin: 0 0 0.5rem;
	padding: 0;
	clear: both;
}

.cw-case-action-btn {
	display: inline-block;
	padding: 0.55rem 1.25rem;
	border: 2px solid #2ea3f2;
	border-radius: 3px;
	background: transparent;
	color: #2ea3f2;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.cw-case-action-btn:hover,
.cw-case-action-btn:focus-visible {
	background: rgba(46, 163, 242, 0.08);
	color: #2ea3f2;
	text-decoration: none;
	outline: 2px solid rgba(46, 163, 242, 0.35);
	outline-offset: 2px;
}

.cw-case-section {
	margin: 0 0 2.5rem;
}

.cw-case-section h2 {
	margin: 0 0 1rem;
	padding-top: 0.25rem;
	line-height: 1.3;
}

.cw-case-section p {
	margin: 0 0 1rem;
}

.cw-case-section p:last-child {
	margin-bottom: 0;
}

.cw-case-focus-list {
	margin: 0;
	padding-left: 1.35rem;
}

.cw-case-focus-list li {
	margin: 0 0 0.55rem;
	line-height: 1.55;
}

.cw-case-focus-list li:last-child {
	margin-bottom: 0;
}

.cw-case-evidence {
	margin-top: 0.5rem;
}

.cw-case-evidence-heading h2 {
	margin: 0 0 0.5rem;
}

.cw-case-timeline {
	margin-top: 0.5rem;
	padding-top: 0;
}

.cw-case-timeline h2 {
	margin: 0 0 1rem;
}

.cw-case-evidence {
	width: 100%;
}

.cw-case-evidence-intro {
	margin: 0.35em 0 0;
	opacity: 0.85;
}

.cw-case-evidence-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.5rem;
	width: 100%;
	align-items: stretch;
	margin: 1.5rem 0 0;
}

.cw-evidence-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	min-height: 240px;
	margin: 0;
	padding: 1.25rem 1.35rem;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	text-align: left;
	font: inherit;
	color: inherit;
}

button.cw-evidence-card {
	cursor: pointer;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

button.cw-evidence-card:hover,
button.cw-evidence-card:focus-visible {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
	outline: 2px solid rgba(21, 101, 192, 0.35);
	outline-offset: 2px;
}

.cw-evidence-card--empty {
	background: #fafafa;
	border-style: dashed;
}

.cw-evidence-card__header {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.cw-evidence-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	font-size: 1.5rem;
	line-height: 1;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.05);
	flex-shrink: 0;
}

.cw-evidence-card__titles {
	flex: 1;
	min-width: 0;
}

.cw-evidence-card__title {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.3;
}

.cw-evidence-card__status {
	display: inline-block;
	margin-top: 0.35rem;
	padding: 0.2rem 0.55rem;
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.07);
}

.cw-evidence-card--has-content .cw-evidence-card__status {
	background: rgba(46, 125, 50, 0.15);
	color: #2e7d32;
}

.cw-evidence-card--empty .cw-evidence-card__status {
	background: rgba(0, 0, 0, 0.06);
	color: rgba(0, 0, 0, 0.55);
}

.cw-evidence-card__description {
	margin: 0 0 0.85rem;
	font-size: 0.92rem;
	line-height: 1.5;
	opacity: 0.88;
	flex: 1;
}

.cw-evidence-card__body {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 0.35rem;
	margin-top: auto;
}

.cw-evidence-card__hint {
	margin: 0;
	font-size: 0.85rem;
	font-weight: 600;
	color: #1565c0;
}

.cw-evidence-card__placeholder {
	margin: 0;
	padding: 0.75rem 0.85rem;
	font-size: 0.88rem;
	line-height: 1.45;
	font-style: italic;
	color: rgba(0, 0, 0, 0.55);
	background: rgba(0, 0, 0, 0.03);
	border-radius: 4px;
	border-left: 3px solid rgba(0, 0, 0, 0.12);
}

.cw-evidence-card__action {
	margin: 0;
}

.cw-evidence-card__link {
	font-weight: 600;
	text-decoration: none;
}

.cw-evidence-card__link:hover {
	text-decoration: underline;
}

.cw-evidence-card__count {
	margin: 0;
	font-size: 0.85rem;
	opacity: 0.75;
}

/* Purpose accent colors */
.cw-evidence-card--court_documents { border-top: 3px solid #1565c0; }
.cw-evidence-card--photos { border-top: 3px solid #6a1b9a; }
.cw-evidence-card--videos { border-top: 3px solid #c62828; }
.cw-evidence-card--public_records { border-top: 3px solid #ef6c00; }
.cw-evidence-card--news_articles { border-top: 3px solid #00838f; }
.cw-evidence-card--downloads { border-top: 3px solid #2e7d32; }

.cw-evidence-card--court_documents .cw-evidence-card__icon { background: rgba(21, 101, 192, 0.12); }
.cw-evidence-card--photos .cw-evidence-card__icon { background: rgba(106, 27, 154, 0.12); }
.cw-evidence-card--videos .cw-evidence-card__icon { background: rgba(198, 40, 40, 0.12); }
.cw-evidence-card--public_records .cw-evidence-card__icon { background: rgba(239, 108, 0, 0.12); }
.cw-evidence-card--news_articles .cw-evidence-card__icon { background: rgba(0, 131, 143, 0.12); }
.cw-evidence-card--downloads .cw-evidence-card__icon { background: rgba(46, 125, 50, 0.12); }

.cw-case-sidebar__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cw-case-sidebar__item {
	margin: 0 0 0.85rem;
	padding: 0 0 0.85rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.cw-case-sidebar__item:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: 0;
}

.cw-case-sidebar__link {
	display: block;
	font-weight: 600;
	line-height: 1.35;
	text-decoration: none;
}

.cw-case-sidebar__link:hover {
	text-decoration: underline;
}

.cw-case-sidebar__status {
	display: block;
	margin-top: 0.25rem;
	font-size: 0.82rem;
	opacity: 0.75;
}

.cw-case-sidebar__empty {
	margin: 0;
	font-size: 0.92rem;
	opacity: 0.8;
}

.cw-case-sidebar__all {
	margin: 1rem 0 0;
	font-size: 0.92rem;
}

/* Modal viewer */
body.cw-evidence-modal-open {
	overflow: hidden;
}

.cw-evidence-modal[hidden] {
	display: none !important;
}

.cw-evidence-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
}

.cw-evidence-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
}

.cw-evidence-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(960px, 100%);
	max-height: calc(100vh - 3rem);
	overflow: auto;
	background: #fff;
	border-radius: 8px;
	padding: 1.25rem 1.5rem 1.5rem;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.cw-evidence-modal__close {
	position: absolute;
	top: 0.5rem;
	right: 0.75rem;
	border: 0;
	background: transparent;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	color: #333;
}

.cw-evidence-modal__title {
	margin: 0 2rem 0.35rem 0;
	font-size: 1.2rem;
}

.cw-evidence-modal__counter {
	margin: 0 0 1rem;
	font-size: 0.85rem;
	opacity: 0.7;
}

.cw-evidence-modal__figure {
	margin: 0;
	text-align: center;
}

.cw-evidence-modal__image {
	max-width: 100%;
	height: auto;
	border-radius: 4px;
}

.cw-evidence-modal__video {
	width: 100%;
	max-height: 70vh;
	background: #000;
	border-radius: 4px;
}

.cw-evidence-modal__embed {
	position: relative;
	width: 100%;
	padding-top: 56.25%;
}

.cw-evidence-modal__embed--oembed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: 4px;
}

.cw-evidence-modal__external {
	margin: 0.75rem 0 0;
	font-size: 0.9rem;
	text-align: center;
}

.cw-evidence-file-provider {
	margin: 0.25rem 0 0 !important;
}

.cw-evidence-modal__doc {
	width: 100%;
	height: 70vh;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.cw-evidence-modal__download {
	margin: 0.75rem 0 0;
}

.cw-evidence-modal__link-card {
	padding: 1rem;
	background: #f7f7f7;
	border-radius: 4px;
}

.cw-evidence-modal__nav {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 1rem;
}

@media (max-width: 980px) {
	.cw-case-evidence-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.25rem;
	}
}

@media (max-width: 600px) {
	.cw-case-evidence-grid {
		grid-template-columns: 1fr;
	}

	.cw-evidence-card {
		min-height: 0;
	}

	.cw-evidence-modal {
		padding: 0.75rem;
	}
}
