/* ==========================================================================
   Espace Documentaire – Template single-document
   ========================================================================== */

/* --------------------------------------------------------------------------
   Conteneur 2 colonnes
   -------------------------------------------------------------------------- */
.ed-single-document {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 32px 20px;
	box-sizing: border-box;
}

.ed-single-document__inner {
	display: grid;
	grid-template-columns: 1fr 380px;
	gap: 48px;
	align-items: start;
}

/* --------------------------------------------------------------------------
   Colonne gauche – contenu
   -------------------------------------------------------------------------- */
.ed-single-document__header {
	margin-bottom: 28px;
}

.ed-single-document__cats {
	font-size: 13px;
	color: #6b7280;
	margin-bottom: 10px;
	text-transform: uppercase;
	letter-spacing: .04em;
}

.ed-single-document__cats a {
	color: inherit;
	text-decoration: none;
}

.ed-single-document__cats a:hover {
	text-decoration: underline;
}

.ed-single-document__title {
	font-size: clamp( 22px, 3vw, 32px );
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 10px;
}

.ed-single-document__date {
	font-size: 13px;
	color: #9ca3af;
	margin: 0 0 12px;
}

.ed-single-document__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	font-size: 12px;
}

.ed-single-document__tags a {
	background: #f3f4f6;
	color: #374151;
	padding: 3px 10px;
	border-radius: 20px;
	text-decoration: none;
	transition: background 0.15s;
}

.ed-single-document__tags a:hover {
	background: #e5e7eb;
}

.ed-single-document__body {
	font-size: 16px;
	line-height: 1.7;
	color: #374151;
}

/* --------------------------------------------------------------------------
   Colonne droite – sidebar / aperçu
   -------------------------------------------------------------------------- */
.ed-single-document__sidebar {
	position: sticky;
	top: 24px;
}

.ed-single-document__preview-box {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	overflow: hidden;
}

/* Visionneuse PDF */
.ed-single-document__pdf-viewer {
	width: 100%;
	aspect-ratio: 3 / 4;
	background: #e5e7eb;
}

.ed-single-document__pdf-object,
.ed-single-document__pdf-iframe {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

/* Aperçu image / icône (fichier non-PDF) */
.ed-single-document__file-preview {
	width: 100%;
	aspect-ratio: 3 / 4;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f3f4f6;
}

.ed-single-document__file-icon svg {
	width: 100px;
	height: 120px;
	display: block;
}

/* Aucun fichier */
.ed-single-document__no-file {
	padding: 40px 24px;
	text-align: center;
	color: #9ca3af;
	font-size: 14px;
}

/* Bouton télécharger */
.ed-single-document__download-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 16px 20px;
	background: #111;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	border: none;
	cursor: pointer;
	transition: background 0.15s;
	box-sizing: border-box;
}

.ed-single-document__download-btn:hover {
	background: #374151;
	color: #fff;
}

.ed-single-document__download-btn svg {
	flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media ( max-width: 900px ) {
	.ed-single-document__inner {
		grid-template-columns: 1fr;
		gap: 32px;
	}

	/* Sur mobile, la sidebar passe en premier (aperçu visible avant le texte) */
	.ed-single-document__sidebar {
		order: -1;
		position: static;
	}

	.ed-single-document__pdf-viewer,
	.ed-single-document__file-preview {
		aspect-ratio: 4 / 3;
	}
}
