/* Pratcom – Études de cas : front-end.
 * Colors follow the theme: theme.json presets (block themes, Pratcom Base),
 * then neutral fallbacks. Override any --pedc-* variable in the theme or child theme. */

body {
	--pedc-accent: var(--wp--preset--color--primary, #1f6f54);
	--pedc-text: var(--wp--preset--color--contrast, #1d2327);
	--pedc-muted: var(--wp--preset--color--muted, #5f6b73);
	--pedc-surface: var(--wp--preset--color--surface, #f5f7f8);
	--pedc-border: var(--wp--preset--color--border, #e2e6e9);
	--pedc-radius: 10px;
	--pedc-gap: clamp(16px, 2.5vw, 28px);
	--pedc-max: 1140px;
}

/* Page wrapper (classic templates only) */
.pedc-page {
	max-width: var(--pedc-max);
	margin-inline: auto;
	padding: clamp(24px, 4vw, 56px) 20px;
	box-sizing: border-box;
}
.pedc-page > * + * { margin-top: var(--pedc-gap); }

/* Single */
.pedc-single__header { max-width: 820px; }
.pedc-single__sector,
.pedc-card__sector {
	margin: 0 0 .4em;
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--pedc-accent);
}
.pedc-single__sector a { color: inherit; text-decoration: none; }
.pedc-single__title { margin: 0 0 .35em; }
.pedc-single__lead { font-size: 1.15em; color: var(--pedc-muted); margin: 0; }
.pedc-single__media { margin: var(--pedc-gap) 0; }
.pedc-single__media img { display: block; width: 100%; height: auto; border-radius: var(--pedc-radius); }
.pedc-single__content { max-width: 820px; margin-block: var(--pedc-gap); }
.pedc-single > * + * { margin-top: var(--pedc-gap); }

/* Project sheet */
.pedc-sheet { display: grid; gap: var(--pedc-gap); margin-block: var(--pedc-gap); }
.pedc-sheet__facts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--pedc-gap);
	padding: clamp(16px, 2.5vw, 24px);
	background: var(--pedc-surface);
	border: 1px solid var(--pedc-border);
	border-radius: var(--pedc-radius);
}
.pedc-sheet__logo img { display: block; max-width: 140px; max-height: 64px; width: auto; height: auto; object-fit: contain; }
.pedc-sheet__facts dl {
	flex: 1 1 320px;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px 24px;
	margin: 0;
}
.pedc-sheet__facts dt {
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--pedc-muted);
}
.pedc-sheet__facts dd { margin: .15em 0 0; font-weight: 500; color: var(--pedc-text); }
.pedc-sheet__facts dd a { color: inherit; }

.pedc-results {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: var(--pedc-gap);
}
.pedc-results li {
	margin: 0;
	padding: 18px 20px;
	border-left: 4px solid var(--pedc-accent);
	background: var(--pedc-surface);
	border-radius: 0 var(--pedc-radius) var(--pedc-radius) 0;
}
.pedc-results__value { display: block; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.1; font-weight: 700; color: var(--pedc-accent); }
.pedc-results__label { display: block; margin-top: .3em; color: var(--pedc-muted); font-size: .95em; }

.pedc-testimonial { margin: 0; padding: clamp(20px, 3vw, 32px); border-radius: var(--pedc-radius); background: var(--pedc-surface); }
.pedc-testimonial blockquote { margin: 0; padding: 0; border: 0; font-size: 1.15em; font-style: italic; }
.pedc-testimonial blockquote p { margin: 0; }
.pedc-testimonial blockquote p::before { content: "\201C"; }
.pedc-testimonial blockquote p::after { content: "\201D"; }
:lang(fr) .pedc-testimonial blockquote p::before { content: "\00AB\00A0"; }
:lang(fr) .pedc-testimonial blockquote p::after { content: "\00A0\00BB"; }
.pedc-testimonial figcaption { margin-top: .75em; font-weight: 600; }
.pedc-testimonial figcaption::before { content: "\2014\00A0"; }

/* Cards and grid */
.pedc-grid {
	display: grid;
	grid-template-columns: repeat(var(--pedc-cols, 3), minmax(0, 1fr));
	gap: var(--pedc-gap);
}
@media (max-width: 960px) { .pedc-grid:not([style*="--pedc-cols:1"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .pedc-grid { grid-template-columns: 1fr; } }

.pedc-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--pedc-border);
	border-radius: var(--pedc-radius);
	transition: box-shadow .2s ease, transform .2s ease;
}
.pedc-card:hover { box-shadow: 0 10px 30px rgba(0, 0, 0, .08); transform: translateY(-2px); }
.pedc-card:focus-within { outline: 2px solid var(--pedc-accent); outline-offset: 2px; }
.pedc-card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--pedc-surface); }
.pedc-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pedc-card__body { display: flex; flex-direction: column; gap: .4em; padding: 20px; flex: 1; }
.pedc-card__body > * { margin: 0; }
.pedc-card__title { font-size: 1.2rem; line-height: 1.3; }
.pedc-card__title a { color: var(--pedc-text); text-decoration: none; }
.pedc-card__title a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.pedc-card__client { font-weight: 600; color: var(--pedc-muted); font-size: .9rem; }
.pedc-card__excerpt { color: var(--pedc-muted); font-size: .95rem; }
.pedc-card__result { margin-top: auto !important; padding-top: .6em; border-top: 1px solid var(--pedc-border); font-size: .9rem; }
.pedc-card__result strong { color: var(--pedc-accent); font-size: 1.1rem; }
@media (prefers-reduced-motion: reduce) { .pedc-card { transition: none; } .pedc-card:hover { transform: none; } }

/* Inside a block-theme Query Loop, the grid comes from the post template. */
.wp-block-post-template .pedc-card { height: 100%; }

/* Archive header, filter, pagination */
.pedc-archive__title { margin: 0 0 .3em; }
.pedc-archive__description { color: var(--pedc-muted); max-width: 820px; }
.pedc-filter ul { list-style: none; margin: var(--pedc-gap) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pedc-filter li { margin: 0; }
.pedc-filter a {
	display: inline-block;
	padding: .45em 1em;
	border: 1px solid var(--pedc-border);
	border-radius: 999px;
	font-size: .9rem;
	text-decoration: none;
	color: var(--pedc-text);
}
.pedc-filter a:hover { border-color: var(--pedc-accent); }
.pedc-filter a[aria-current="page"] { background: var(--pedc-accent); border-color: var(--pedc-accent); color: #fff; }
.pedc-pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pedc-pagination .page-numbers { padding: .4em .8em; border-radius: 6px; text-decoration: none; }
.pedc-pagination .page-numbers.current { background: var(--pedc-accent); color: #fff; }

/* Related */
.pedc-related { margin-top: clamp(40px, 6vw, 72px); }
.pedc-related__title { margin: 0 0 var(--pedc-gap); }

/* Block-theme single template: sector label above the title. */
.wp-block-post-terms.taxonomy-etude_secteur {
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--pedc-accent);
}
.wp-block-post-terms.taxonomy-etude_secteur a { color: inherit; text-decoration: none; }
