/**
 * Espace Collaborateurs — Styles front
 *
 * Raccord avec le thème Valière Cortez :
 * Font Muli, palette gold/charcoal, uppercase headings, VW sizing.
 */

/* ============================================
   Variables — alignées sur le thème VC
   ============================================ */
:root {
	--ec-gold: #ebcfb5;
	--ec-accent: var(--ec-gold);
	--ec-charcoal: #5f6368;
	--ec-charcoal-dark: #313131;
	--ec-blue: #879ebc;
	--ec-teal: #9cc0c6;
	--ec-text: #000;
	--ec-text-light: #5f6368;
	--ec-text-muted: #959595;
	--ec-border: #cbcbcb;
	--ec-bg: #fff;
	--ec-bg-alt: #f4f4f4;
	--ec-font: 'Muli', Verdana, sans-serif;
	--ec-transition: 0.3s linear;
}

/* ============================================
   Login — hero layout (même structure que hub/espace)
   ============================================ */
.ec-login {
	max-width: 100%;
}

.ec-login-hero {
	display: flex;
	white-space: nowrap;
	height: auto;
	max-height: calc(100vh - 7.03vw);
	background: none;
	margin-left: -4.69vw;
	margin-right: -4.69vw;
}

.ec-login-hero-image {
	white-space: normal;
	width: 47.4vw;
	flex-shrink: 0;
	margin-right: 4.69vw;
	overflow: hidden;
	background: var(--ec-bg-alt);
}

.ec-login-hero-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ec-login-hero-content {
	white-space: normal;
	font-weight: 400;
	color: var(--ec-charcoal);
	display: flex;
	flex-direction: column;
	width: 43.23vw;
	margin-top: 2.6vw;
	padding-right: 4.69vw;
	box-sizing: border-box;
}

.ec-login-title {
	font-family: var(--ec-font);
	font-size: 2.6vw;
	line-height: 3.13vw;
	font-weight: 400;
	text-transform: uppercase;
	color: var(--ec-accent);
	margin: 0 0 2.6vw;
}

.ec-login-form .ec-field:first-of-type {
	margin-top: 0;
}

/* ============================================
   Alerts
   ============================================ */
.ec-alert {
	padding: 1.04vw 1.3vw;
	margin-bottom: 1.56vw;
	font-family: var(--ec-font);
	font-size: 0.83vw;
	line-height: 1.5;
}

.ec-alert--error {
	background: #fef2f2;
	color: #991b1b;
	border-left: 3px solid #ef4444;
}

.ec-alert--info {
	background: #f0f4f8;
	color: var(--ec-charcoal);
	border-left: 3px solid var(--ec-blue);
}

.ec-alert--warning {
	background: #fffbeb;
	color: #92400e;
	border-left: 3px solid var(--ec-accent);
}

.ec-alert--success {
	background: #f0fdf4;
	color: #166534;
	border-left: 3px solid #22c55e;
}

/* ============================================
   Form fields
   ============================================ */
.ec-field {
	margin-bottom: 1.3vw;
}

.ec-label {
	display: block;
	font-family: var(--ec-font);
	font-weight: 500;
	font-size: 0.78vw;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ec-text);
	margin-bottom: 0.52vw;
}

.ec-input {
	display: block;
	width: 100%;
	padding: 0.78vw 1.04vw;
	border: 1px solid var(--ec-charcoal);
	background: var(--ec-bg);
	font-family: var(--ec-font);
	font-size: 0.89vw;
	color: var(--ec-text);
	box-sizing: border-box;
	transition: border-color var(--ec-transition);
}

.ec-input:focus {
	outline: none;
	border-color: var(--ec-text);
}

/* ============================================
   Buttons — style VC (charcoal, uppercase)
   ============================================ */
.ec-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.52vw;
	padding: 0.94vw 1.82vw;
	border: none;
	font-family: var(--ec-font);
	font-size: 0.78vw;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	cursor: pointer;
	text-decoration: none;
	transition: background var(--ec-transition), opacity var(--ec-transition);
	line-height: 1.4;
}

.ec-btn--primary {
	background: var(--ec-charcoal);
	color: #fff;
}

.ec-btn--primary:hover {
	background: var(--ec-charcoal-dark);
}

.ec-btn--outline {
	background: transparent;
	border: 1px solid var(--ec-charcoal);
	color: var(--ec-charcoal);
}

.ec-btn--outline:hover {
	background: var(--ec-charcoal);
	color: #fff;
}

.ec-btn--sm {
	padding: 0.52vw 1.04vw;
	font-size: 0.73vw;
}

.ec-login-form .ec-btn {
	width: 100%;
	margin-top: 0.78vw;
	padding: 1.04vw;
}

/* ============================================
   User info bar
   ============================================ */
.ec-user-info {
	display: flex;
	align-items: center;
	gap: 1.04vw;
}

.ec-user-name {
	font-family: var(--ec-font);
	font-weight: 400;
	font-size: 0.89vw;
	color: var(--ec-text-light);
}

/* ============================================
   Page overrides (hub/espace/login) — injectés inline via wp_head
   dans EC_TemplateController::inject_page_overrides()
   pour contourner le body_class statique de Timber.
   ============================================ */

/* ============================================
   Hub — page d'accueil espaces
   ============================================ */
.ec-hub {
	max-width: 100%;
}

/* Hero : reproduit le layout .head.wrapper du thème VC
   Contexte : notre contenu est dans .wrapper.content > .text-content
   .wrapper.content a padding: 0 4.69vw
   On déborde avec des marges négatives pour atteindre les bords viewport */
.ec-hub-hero {
	display: flex;
	white-space: nowrap;
	height: auto;
	max-height: calc(100vh - 7.03vw);
	background: none;
	/* Déborder du .wrapper.content */
	margin-left: -4.69vw;
	margin-right: -4.69vw;
	margin-bottom: 3.91vw;
}

/* Image gauche — même dimensions que .head .left */
.ec-hub-hero-image {
	white-space: normal;
	width: 47.4vw;
	flex-shrink: 0;
	margin-right: 4.69vw;
	overflow: hidden;
	background: var(--ec-bg-alt);
}

.ec-hub-hero-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Contenu droite — même dimensions que .head .right */
.ec-hub-hero-content {
	white-space: normal;
	font-weight: 400;
	color: var(--ec-accent);
	display: flex;
	flex-direction: column;
	width: 43.23vw;
	margin-top: 2.6vw;
	padding-right: 4.69vw;
	box-sizing: border-box;
}

/* Titre — même typo que .head .right h1 */
.ec-hub-greeting {
	font-family: var(--ec-font);
	font-size: 2.6vw;
	line-height: 3.13vw;
	font-weight: 400;
	text-transform: uppercase;
	color: inherit;
	margin: 0 0 2.6vw;
}

/* Intro — même typo que .head .right .text-content */
.ec-hub-intro {
	font-family: var(--ec-font);
	font-size: 1.3vw;
	line-height: 1.61vw;
	color: var(--ec-text-light);
	margin: 0;
}

.ec-hub-intro p {
	margin: 0 0 0.52vw;
}

.ec-hub-intro p:last-child {
	margin-bottom: 0;
}

/* Actions (déconnexion) — sous le texte */
.ec-hub-hero-actions {
	margin-top: 3rem;
	padding-bottom: 2.6vw;
}

/* Hub sections groupées par activité */
.ec-hub-section {
	margin-bottom: 3.13vw;
	padding-left: 4.69vw;
	padding-right: 4.69vw;
}

.ec-hub-section-title {
	font-family: var(--ec-font);
	font-size: 1.82vw;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ec-accent);
	margin: 0 0 1.56vw;
}

.ec-hub-section-desc {
	font-family: var(--ec-font);
	font-size: 0.89vw;
	color: var(--ec-text-light);
	margin: -0.78vw 0 1.56vw;
	line-height: 1.5;
}

.ec-hub-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.56vw;
}

.ec-hub-card {
	display: flex;
	flex-direction: column;
	background: var(--ec-bg-alt);
	padding: 2.08vw;
	text-decoration: none;
	color: inherit;
	transition: opacity var(--ec-transition);
	position: relative;
}

.ec-hub-card::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 3px;
	background: var(--ec-accent);
	transform: scaleX(0);
	transform-origin: right;
	transition: transform 0.4s cubic-bezier(0.9, 0, 0.1, 1);
}

.ec-hub-card:hover::after {
	transform: scaleX(1);
	transform-origin: left;
}

.ec-hub-card-title {
	font-family: var(--ec-font);
	font-size: 1.3vw;
	font-weight: 700;
	text-transform: uppercase;
	margin: 0 0 0.52vw;
	color: var(--ec-text);
}

.ec-hub-card-desc {
	font-family: var(--ec-font);
	font-size: 0.83vw;
	color: var(--ec-text-light);
	margin: 0 0 0.78vw;
	flex: 1;
	line-height: 1.5;
}

.ec-hub-card-count {
	font-family: var(--ec-font);
	font-size: 0.73vw;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ec-text-muted);
}

/* ============================================
   Espace page — hero + documents
   ============================================ */
.ec-espace {
	max-width: 100%;
}

/* Hero : même layout que le hub (image gauche, contenu droite) */
.ec-espace-hero {
	display: flex;
	white-space: nowrap;
	height: auto;
	max-height: calc(100vh - 7.03vw);
	background: none;
	margin-left: -4.69vw;
	margin-right: -4.69vw;
	margin-bottom: 3.91vw;
}

.ec-espace-hero-image {
	white-space: normal;
	width: 47.4vw;
	flex-shrink: 0;
	margin-right: 4.69vw;
	overflow: hidden;
	background: var(--ec-bg-alt);
}

.ec-espace-hero-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ec-espace-hero-content {
	white-space: normal;
	font-weight: 400;
	color: var(--ec-charcoal);
	display: flex;
	flex-direction: column;
	width: 43.23vw;
	margin-top: 2.6vw;
	padding-right: 4.69vw;
	box-sizing: border-box;
}

.ec-espace-title {
	font-family: var(--ec-font);
	font-size: 2.6vw;
	line-height: 3.13vw;
	font-weight: 400;
	text-transform: uppercase;
	color: var(--ec-accent);
	margin: 0 0 2.6vw;
}

.ec-espace-desc {
	font-family: var(--ec-font);
	font-size: 1.3vw;
	line-height: 1.61vw;
	color: var(--ec-text-light);
	margin: 0;
}

.ec-espace-desc p {
	margin: 0 0 0.52vw;
}

.ec-espace-desc p:last-child {
	margin-bottom: 0;
}

.ec-espace-hero-actions {
	margin-top: 3rem;
	padding-bottom: 2.6vw;
}

/* Document groups par type */
.ec-groupe-type {
	margin-bottom: 3.13vw;
	padding-left: 4.69vw;
	padding-right: 4.69vw;
}

.ec-type-titre {
	font-family: var(--ec-font);
	font-size: 1.82vw;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ec-accent);
	margin: 0 0 1.56vw;
}

/* ============================================
   Document cards — style actus VC
   ============================================ */
.ec-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.56vw;
}

.ec-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	transition: opacity var(--ec-transition);
}

.ec-card:hover {
	opacity: 0.85;
}

/* Thumbnail — style VC (pas de border-radius) */
.ec-card-thumbnail {
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--ec-bg-alt);
	margin-bottom: 1.04vw;
}

.ec-card-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.16, 1.08, 0.38, 0.98);
}

.ec-card:hover .ec-card-thumbnail img {
	transform: scale(1.03);
}

/* Body : titre gold + date tiret cadratin */
.ec-card-body {
	display: flex;
	flex-direction: column;
	gap: 0.26vw;
}

.ec-card-title {
	font-family: var(--ec-font);
	font-size: 1.3vw;
	font-weight: 700;
	text-transform: uppercase;
	margin: 0;
	line-height: 1.3;
	color: var(--ec-accent);
}

.ec-card-date {
	font-family: var(--ec-font);
	font-size: 0.73vw;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ec-text);
	display: block;
}

/* Card sans image — fond alt pour rythmer */
.ec-card:not(:has(.ec-card-thumbnail)) .ec-card-body {
	background: var(--ec-bg-alt);
	padding: 2.08vw;
}

/* ============================================
   Breadcrumb
   ============================================ */
.ec-breadcrumb {
	margin-bottom: 2.08vw;
}

ol.ec-breadcrumb-list {
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
	display: flex;
	gap: 0.52vw;
	font-family: var(--ec-font);
	font-size: 0.73vw;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ec-text-muted);
}

ol.ec-breadcrumb-list li {
	list-style: none !important;
}

.ec-breadcrumb-item + .ec-breadcrumb-item::before {
	content: "/";
	margin-right: 0.52vw;
	color: var(--ec-border);
}

.ec-breadcrumb-item a {
	color: var(--ec-charcoal);
	text-decoration: none;
	transition: color 0.4s;
}

.ec-breadcrumb-item a:hover {
	color: var(--ec-text);
}

.ec-breadcrumb-item--active {
	color: var(--ec-text);
}

/* ============================================
   Footer link (shortcode)
   ============================================ */
.ec-footer-link {
	font-family: var(--ec-font);
	font-size: 0.73vw;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: inherit;
	text-decoration: none;
	opacity: 0.7;
	transition: opacity var(--ec-transition);
}

.ec-footer-link:hover {
	opacity: 1;
}

/* ============================================
   Empty state
   ============================================ */
.ec-vide {
	text-align: center;
	padding: 5.21vw 4.69vw;
	font-family: var(--ec-font);
	font-size: 0.89vw;
	color: var(--ec-text-muted);
}

/* ============================================
   Responsive — breakpoint 1920px+ (px fixes)
   ============================================ */
@media (min-width: 1920px) {
	.ec-hub-hero,
	.ec-espace-hero,
	.ec-login-hero {
		margin-left: -90px;
		margin-right: -90px;
	}

	.ec-hub-hero-image,
	.ec-espace-hero-image,
	.ec-login-hero-image {
		margin-right: 90px;
	}

	.ec-hub-hero-content,
	.ec-espace-hero-content,
	.ec-login-hero-content {
		padding-right: 90px;
		margin-top: 50px;
	}

	.ec-hub-greeting,
	.ec-espace-title,
	.ec-login-title {
		font-size: 40px;
		line-height: 48px;
		margin-bottom: 50px;
	}

	.ec-hub-intro,
	.ec-espace-desc {
		font-size: 25px;
		line-height: 31px;
	}

	.ec-hub-hero-actions,
	.ec-espace-hero-actions {
		padding-bottom: 50px;
	}

	.ec-hub-section,
	.ec-groupe-type,
	.ec-vide {
		padding-left: 0;
		padding-right: 0;
	}

	.ec-hub-section-title,
	.ec-type-titre {
		font-size: 35px;
	}

	.ec-hub-card-title,
	.ec-card-title {
		font-size: 25px;
	}

	.ec-hub-intro,
	.ec-espace-desc,
	.ec-user-name,
	.ec-input {
		font-size: 17px;
		line-height: 21px;
	}

	.ec-label,
	.ec-btn {
		font-size: 15px;
	}

	.ec-btn--sm,
	.ec-hub-card-count,
	.ec-card-date,
	.ec-breadcrumb-list,
	.ec-footer-link {
		font-size: 14px;
	}

	.ec-alert {
		font-size: 16px;
	}

	.ec-vide {
		font-size: 17px;
	}
}

/* ============================================
   Responsive — tablette
   ============================================ */
@media (max-width: 1024px) {
	.ec-hub-hero,
	.ec-espace-hero,
	.ec-login-hero {
		flex-direction: column;
		max-height: none;
		margin-left: -30px;
		margin-right: -30px;
	}

	.ec-hub-hero-image,
	.ec-espace-hero-image,
	.ec-login-hero-image {
		width: 100%;
		margin-right: 0;
		max-height: 50vh;
	}

	.ec-hub-hero-content,
	.ec-espace-hero-content,
	.ec-login-hero-content {
		width: auto;
		padding: 30px;
		margin-top: 0;
	}

	.ec-hub-greeting,
	.ec-espace-title,
	.ec-login-title {
		font-size: 24px;
		line-height: 1.2;
		margin-bottom: 20px;
	}

	.ec-hub-intro,
	.ec-espace-desc {
		font-size: 14px;
		line-height: 1.5;
	}

	.ec-hub-hero-actions,
	.ec-espace-hero-actions {
		margin-top: 20px;
		padding-bottom: 0;
	}

	.ec-hub-section,
	.ec-groupe-type {
		padding-left: 0;
		padding-right: 0;
	}

	.ec-hub-grid,
	.ec-cards {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px;
	}

	.ec-hub-section-title,
	.ec-type-titre {
		font-size: 22px;
	}

	.ec-hub-card-title,
	.ec-card-title {
		font-size: 16px;
	}

	.ec-hub-intro,
	.ec-espace-desc,
	.ec-user-name,
	.ec-input,
	.ec-hub-card-desc {
		font-size: 14px;
	}

	.ec-label,
	.ec-btn {
		font-size: 13px;
	}

	.ec-btn--sm,
	.ec-hub-card-count,
	.ec-card-date,
	.ec-breadcrumb-list {
		font-size: 12px;
	}

	.ec-alert {
		font-size: 13px;
		padding: 12px 16px;
	}

	.ec-btn {
		padding: 12px 24px;
	}

	.ec-btn--sm {
		padding: 8px 16px;
	}

	.ec-hub-card {
		padding: 24px;
	}

}

/* ============================================
   Responsive — mobile
   ============================================ */
@media (max-width: 640px) {
	.ec-hub-hero,
	.ec-espace-hero,
	.ec-login-hero {
		margin-left: -20px;
		margin-right: -20px;
	}

	.ec-hub-hero-content,
	.ec-espace-hero-content,
	.ec-login-hero-content {
		padding: 20px;
	}

	.ec-hub-greeting,
	.ec-espace-title,
	.ec-login-title {
		font-size: 20px;
		line-height: 1.2;
		margin-bottom: 16px;
	}

	.ec-hub-section,
	.ec-groupe-type {
		padding-left: 0;
		padding-right: 0;
	}

	.ec-hub-grid,
	.ec-cards {
		grid-template-columns: 1fr;
	}

	.ec-hub-section-title,
	.ec-type-titre {
		font-size: 20px;
	}

	.ec-hub-card-title,
	.ec-card-title {
		font-size: 15px;
	}

	.ec-vide {
		font-size: 14px;
		padding: 40px 20px;
	}

	.ec-footer-link {
		font-size: 12px;
	}
}
