/* Note: page width is now handled by Salient's own .container class
   (used in the templates below) instead of a custom width here. */

/* ===== Category grid (image 1) ===== */
.tsc-grid {
	display: grid;
	grid-template-columns: repeat(var(--tsc-columns, 4), 1fr);
	gap: 20px;
	margin: 24px 0;
}
@media (max-width: 900px) {
	.tsc-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
	.tsc-grid { grid-template-columns: 1fr; }
}

.tsc-box {
	position: relative;
	display: block;
	height: 220px;
	border-radius: 15px;
	overflow: hidden;
	background-size: cover;
	background-position: center;
	background-color: #e9e5da;
	text-decoration: none;
	color: #fff;
	transition: all 0.5s !important;
}
.tsc-box:hover { transform: translateY(-2px); }

.tsc-box-overlay {
	position: absolute;
	inset: 0;
	transition: all 0.5s !important;
	background: #ffffff5c;
}
.tsc-box-icon {
	position: absolute;
	top: 12px;
	left: 12px;
	width: 46px;
	height: 56px;
	z-index: 9;
	transition: all 0.5s !important;
	background: #F0F3FF;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	border-radius: 6px;
}

.tsc-box:hover .tsc-box-icon {
	background: #ffffff8c;
}

.tsc-box:hover .tsc-box-icon img {
	filter: brightness(0) invert(1);
}

.tsc-box-icon img { width: 100%; height: 100%; object-fit: contain; transition: all 0.5s !important; }

.tsc-box:hover .tsc-box-title {
	color: #fff;
}

.tsc-box:hover .tsc-box-overlay {
	background: linear-gradient(45deg, #7e570094, #f9b1119c);
}

.tsc-box-title {
	position: absolute;
	left: 14px;
	bottom: 12px;
	z-index: 2;
	font-weight: 600;
	font-size: 28px;
	line-height: 36px;
	letter-spacing: .03em;
	text-transform: uppercase;
	font-family: 'Avant Garde';
	color: #111C2D;
	transition: all 0.5s;
}

/* ===== Detail page (image 2) ===== */
.tsc-hero {
	display: flex;
	flex-wrap: wrap;
	gap: 30px;
	align-items: center;
	margin: 30px 0 40px;
}
.tsc-hero-text { flex: 1 1 320px; }
.tsc-hero-heading {
	font-size: 32px;
	font-weight: 700;
	margin: 0 0 12px;
}
.tsc-hero-paragraph { color: #555; line-height: 1.6; }
.tsc-hero-image { flex: 1 1 360px; }
.tsc-hero-image img {
	width: 100%;
	height: auto;
	border-radius: 8px;
	display: block;
}

.tsc-documents-title { font-size: 20px; margin-bottom: 16px; }

.tsc-doc-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}
@media (max-width: 900px) {
	.tsc-doc-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
	.tsc-doc-grid { grid-template-columns: 1fr; }
}
.tsc-doc-card {
	border: 1px solid #ececec;
	border-radius: 8px;
	padding: 20px;
	background: #fafafa;
}
.tsc-doc-card-title { margin: 0 0 16px; font-size: 17px; }
.tsc-doc-card-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== Buttons ===== */
.tsc-btn {
	display: inline-block;
	padding: 8px 16px;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	text-align: center;
	cursor: pointer;
}
.tsc-btn-outline {
	border: 1px solid #a67c1e;
	color: #a67c1e;
	background: transparent;
}
.tsc-btn-outline:hover { background: #a67c1e; color: #fff; }

.tsc-btn-solid:hover {background: #8f6a17 !important;color: #fff !important;z-index: 9 !important;}

/* ===== Listing page (image 4) ===== */
.tsc-breadcrumb { font-size: 13px; color: #888; margin-bottom: 10px; }
.tsc-breadcrumb a { color: #888; text-decoration: none; }
.tsc-breadcrumb span { margin: 0 4px; }

.tsc-listing-title { font-size: 26px; margin-bottom: 20px; }

.tsc-doc-list {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 22px;
}
@media (max-width: 900px) {
	.tsc-doc-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
	.tsc-doc-list { grid-template-columns: 1fr; }
}

.tsc-doc-list-item {
	display: flex;
	flex-direction: column;
	border: 1px solid #ececec;
	border-radius: 8px;
	padding: 16px;
	background: #fff;
}
.tsc-doc-list-thumb-wrap {
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 6px;
	margin-bottom: 14px;
	background: #eee;
}
.tsc-doc-list-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.tsc-doc-list-thumb-wrap canvas,
.tsc-doc-card-preview canvas { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.tsc-doc-list-label { font-weight: 600; font-size: 15px; margin-bottom: 14px; }
.tsc-doc-list-actions { display: flex; gap: 10px; margin-top: auto; }
.tsc-doc-list-actions .tsc-btn { flex: 1; }

.tsc-login-note {
	margin-top: 24px;
	padding: 12px 16px;
	background: #fff8e6;
	border: 1px solid #f0dca0;
	border-radius: 4px;
	font-size: 13px;
	margin-bottom: 20px;
}
.tsc-doc-card { position: relative; }
.tsc-doc-card-preview {
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 6px;
	margin-bottom: 14px;
	background: #eee;
}
.tsc-doc-card-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

button.tsc-btn { font-family: Avant Garde; }
button.tsc-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ===== Lightbox (View button) ===== */
.tsc-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(10, 10, 15, .82);
	padding: 30px;
}
.tsc-lightbox.is-open { display: flex; }
body.tsc-lightbox-open { overflow: hidden; }

.tsc-lightbox-inner {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
}
.tsc-lightbox-img {
	max-width: 90vw;
	max-height: 90vh;
	display: block;
	border-radius: 6px;
	box-shadow: 0 10px 40px rgba(0,0,0,.4);
}
.tsc-lightbox-close {
	position: absolute;
	top: -16px;
	right: -16px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: none;
	background: #fff;
	color: #222;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.tsc-empty { color: #888; }

/* ===== Custom PDF viewer ===== */
.tsc-pdf-lightbox {
	align-items: stretch;
	justify-content: center;
	padding: 0;
	background: rgba(10, 10, 15, .88);
}
.tsc-pdf-viewer {
	display: flex;
	flex-direction: column;
	width: min(1100px, 100vw);
	height: min(100vh, 1000px);
	margin: auto;
	background: #f1f1f1;
	box-shadow: 0 12px 50px rgba(0, 0, 0, .42);
}
.tsc-pdf-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 58px;
	padding: 10px 14px 10px 20px;
	background: #22252a;
	color: #fff;
}
.tsc-pdf-toolbar-title {
	min-width: 0;
	overflow: hidden;
	font-size: 14px;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tsc-pdf-toolbar-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}
.tsc-pdf-document-select {
	max-width: 180px;
	padding: 6px 8px;
	border: 1px solid #555;
	border-radius: 3px;
	background: #fff;
	color: #222;
	font: inherit;
}
.tsc-pdf-document-select[hidden] { display: none; }
.tsc-pdf-control,
.tsc-pdf-close {
	border: 1px solid #65686c;
	border-radius: 3px;
	background: transparent;
	color: #fff;
	cursor: pointer;
	font: inherit;
}
.tsc-pdf-control {
	width: 32px;
	height: 32px;
	font-size: 17px;
}
.tsc-pdf-close {
	width: 34px;
	height: 34px;
	margin-left: 4px;
	border-radius: 50%;
	font-size: 21px;
	line-height: 1;
}
.tsc-pdf-control:hover,
.tsc-pdf-close:hover { background: #a67c1e; border-color: #a67c1e; }
.tsc-pdf-control:disabled { opacity: .4; cursor: not-allowed; }
.tsc-pdf-page-count { min-width: 76px; text-align: center; font-size: 12px; color: #e0e0e0; }
.tsc-pdf-status {
	min-height: 0;
	padding: 0 20px;
	background: #f1f1f1;
	color: #666;
	font-size: 13px;
	text-align: center;
}
.tsc-pdf-status:not(:empty) { padding-top: 12px; }
.tsc-pdf-status.is-error { color: #a32424; }
.tsc-pdf-pages {
	flex: 1;
	overflow: auto;
	padding: 24px 16px 32px;
	overscroll-behavior: contain;
}
.tsc-pdf-page {
	width: fit-content;
	max-width: 100%;
	margin: 0 auto 20px;
	background: #fff;
	box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}
.tsc-pdf-page canvas {
	display: block;
	max-width: 100%;
	height: auto;
}
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
@media (max-width: 640px) {
	.tsc-pdf-toolbar { align-items: flex-start; flex-direction: column; gap: 8px; padding: 12px; }
	.tsc-pdf-toolbar-actions { width: 100%; justify-content: flex-end; }
	.tsc-pdf-toolbar-title { width: 100%; }
	.tsc-pdf-document-select { max-width: 130px; }
	.tsc-pdf-pages { padding: 16px 8px 24px; }
}

/* ===== Back button (top-right of detail & document group pages) ===== */
.tsc-page-actions {
	display: flex;
	justify-content: flex-start;
	margin: 20px 0 0;
}
.tsc-back-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	line-height: 1.2;
	font-size: 16px;
	line-height: 24px;
	padding: 12px 30px;
}
.tsc-back-arrow {
	font-size: 15px; line-height: 1;
}
