/* ==========================================================================
   Catalogue C2F — styles du plugin.
   Reprend les variables du thème C2F (--c2f-*) si elles existent, sinon les
   couleurs officielles : #335566 (bleu pétrole), #ac8d4d (doré), #eae5de (beige).
   ========================================================================== */

.c2f-cat {
	--cc-primary: var(--c2f-primary, #335566);
	--cc-primary-dark: var(--c2f-primary-dark, #243c47);
	--cc-accent: var(--c2f-accent, #ac8d4d);
	--cc-accent-dark: var(--c2f-accent-dark, #816a3a);
	--cc-bg: var(--c2f-bg, #eae5de);
	--cc-card: #fff;
	--cc-text: #24302f;
	--cc-muted: #665f52;
	--cc-border: #ddd5c7;
	--cc-success: #2f9e5f;
	--cc-radius: 12px;
	--cc-shadow: 0 2px 10px rgba(51, 85, 102, .10);
	--cc-shadow-hover: 0 8px 24px rgba(51, 85, 102, .18);
	color: var(--cc-text);
	line-height: 1.55;
	box-sizing: border-box;
}
.c2f-cat *, .c2f-cat *::before, .c2f-cat *::after { box-sizing: inherit; }
.c2f-cat-page { background: var(--cc-bg); padding-bottom: 70px; }
.c2f-cat [hidden] { display: none !important; }
.c2f-cat-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.c2f-cat-container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- En-tête de page ---------- */
.c2f-cat-hero {
	background: linear-gradient(120deg, var(--cc-primary), var(--cc-primary-dark));
	color: #fff;
	text-align: center;
	padding: 56px 0 64px;
}
.c2f-cat-hero h1 { color: #fff; margin: 0 0 8px; }
.c2f-cat-hero p { color: #e7e2d8; margin: 0 auto; max-width: 700px; font-size: 1.1rem; }
.c2f-cat-body { padding-top: 0; }

/* ---------- Catégories + recherche ---------- */
.c2f-cat-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 18px; }
.c2f-cat-nav button {
	background: var(--cc-card);
	border: 1px solid var(--cc-border);
	color: var(--cc-primary);
	padding: 8px 16px;
	border-radius: 999px;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
	transition: background .15s, color .15s, border-color .15s;
}
.c2f-cat-nav button:hover { border-color: var(--cc-accent); }
.c2f-cat-nav button.is-active { background: var(--cc-accent); border-color: var(--cc-accent); color: #fff; font-weight: 600; }

.c2f-cat-search input {
	width: 100%;
	padding: 14px 18px;
	border: 1px solid var(--cc-border);
	border-radius: var(--cc-radius);
	box-shadow: var(--cc-shadow);
	font: inherit;
	font-size: 15px;
	background: #fff;
	color: var(--cc-text);
}
.c2f-cat-search input:focus { outline: 2px solid var(--cc-accent); }

/* ---------- Mise en page liste ---------- */
.c2f-cat-layout { display: grid; grid-template-columns: 250px 1fr; gap: 28px; align-items: start; margin-top: 24px; }

.c2f-cat-filters {
	background: var(--cc-card);
	border-radius: var(--cc-radius);
	box-shadow: var(--cc-shadow);
	padding: 20px;
	position: sticky;
	top: 20px;
}
.c2f-cat-filters summary {
	margin: 0 0 14px;
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: 1px;
	font-weight: 700;
	color: var(--cc-primary);
	cursor: pointer;
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.c2f-cat-filters summary::-webkit-details-marker { display: none; }
.c2f-cat-filters summary::after { content: "⌄"; font-size: 18px; color: var(--cc-muted); transition: transform .15s; text-transform: none; }
.c2f-cat-filters[open] summary::after { transform: rotate(180deg); }
.c2f-cat-filters fieldset { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.c2f-cat-filters legend { font-weight: 600; font-size: 13px; color: var(--cc-muted); margin-bottom: 6px; padding: 0; }
.c2f-cat-filters label { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 4px 0; cursor: pointer; margin: 0; }
.c2f-cat-filters select { width: 100%; padding: 8px; border: 1px solid var(--cc-border); border-radius: 6px; font: inherit; font-size: 14px; background: #fff; }
.c2f-cat-reset {
	width: 100%;
	padding: 10px;
	background: none;
	border: 1px solid var(--cc-primary);
	color: var(--cc-primary);
	border-radius: 6px;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
}
.c2f-cat-reset:hover { background: var(--cc-primary); color: #fff; }

.c2f-cat-results-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.c2f-cat-results-head h2 { margin: 0; font-size: 18px; color: var(--cc-primary); }
.c2f-cat-count { color: var(--cc-muted); font-size: 14px; }

.c2f-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

/* ---------- Cartes ---------- */
.c2f-cat-card {
	position: relative;
	background: var(--cc-card);
	border-radius: var(--cc-radius);
	box-shadow: var(--cc-shadow);
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	transition: transform .15s, box-shadow .15s;
}
.c2f-cat-card:hover { transform: translateY(-3px); box-shadow: var(--cc-shadow-hover); }
.c2f-cat-card[hidden] { display: none; }
.c2f-cat-emoji { font-size: 34px; line-height: 1; }
.c2f-cat-tag { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--cc-primary); }
.c2f-cat-card h3 { margin: 0; font-size: 17px; line-height: 1.3; }
.c2f-cat-card h3 a { color: var(--cc-text); text-decoration: none; }
.c2f-cat-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--cc-radius); } /* toute la carte est cliquable */
.c2f-cat-card h3 a:focus-visible::after { outline: 2px solid var(--cc-accent); }
.c2f-cat-summary { margin: 0; flex: 1; font-size: 14px; color: var(--cc-muted); }
.c2f-cat-price { margin: 0; font-size: 15px; font-weight: 700; color: var(--cc-accent-dark); }

.c2f-cat-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.c2f-cat-badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #e7edf0; color: var(--cc-primary); }
.c2f-cat-badge.is-accent { background: #f4ecd8; color: var(--cc-accent-dark); }
.c2f-cat-badge.is-success { background: #e8f7ee; color: var(--cc-success); }

.c2f-cat-empty { text-align: center; padding: 60px 20px; color: var(--cc-muted); }
.c2f-cat-empty span { display: block; font-size: 48px; margin-bottom: 12px; }

/* ---------- Fiche formation ---------- */
.c2f-cat-breadcrumb { margin: 24px 0 0; font-size: 14px; }
.c2f-cat-breadcrumb a { color: var(--cc-primary); font-weight: 600; text-decoration: none; }
.c2f-cat-detail { display: grid; grid-template-columns: 1fr 330px; gap: 28px; align-items: start; margin-top: 16px; }

.c2f-cat-detail-main { background: var(--cc-card); border-radius: var(--cc-radius); box-shadow: var(--cc-shadow); padding: 30px; min-width: 0; }
.c2f-cat-emoji-lg { font-size: 48px; line-height: 1.2; display: block; }
.c2f-cat-detail-main h1 { color: var(--cc-primary); margin: 8px 0 6px; }
.c2f-cat-lead { margin: 0 0 12px; }

.c2f-cat-section { margin-top: 26px; }
.c2f-cat-section h2 {
	font-size: 16px;
	text-transform: uppercase;
	letter-spacing: .5px;
	color: var(--cc-primary);
	border-bottom: 2px solid var(--cc-border);
	padding-bottom: 8px;
	margin: 0 0 12px;
}
.c2f-cat-section p { margin: 0 0 10px; }

/* Programme : bandeaux + accordéon */
.c2f-cat-phase {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--cc-bg);
	border-radius: 999px;
	padding: 12px 18px;
	margin-top: 14px;
	font-weight: 600;
	font-size: 14px;
}
.c2f-cat-item { background: var(--cc-card); border: 1px solid var(--cc-border); border-radius: 10px; padding: 12px 18px; margin-top: 8px; }
.c2f-cat-item summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.c2f-cat-item summary::-webkit-details-marker { display: none; }
.c2f-cat-item summary::after { content: "⌄"; font-size: 18px; color: var(--cc-muted); transition: transform .15s; }
.c2f-cat-item[open] summary::after { transform: rotate(180deg); }
.c2f-cat-item ul { margin: 12px 0 0; padding-left: 20px; color: var(--cc-muted); font-size: 14px; }
.c2f-cat-item li { margin-bottom: 6px; }
.c2f-cat-item-flat { font-weight: 600; }

/* Blocs institutionnels */
.c2f-cat-infocards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.c2f-cat-infocard { border: 2px solid var(--cc-accent); border-radius: 16px; padding: 28px 24px; background: var(--cc-card); min-width: 0; }
.c2f-cat-infocard.is-full { grid-column: 1 / -1; }
.c2f-cat-infocard-icon {
	width: 56px; height: 56px; border-radius: 50%;
	border: 2px solid var(--cc-accent);
	display: flex; align-items: center; justify-content: center;
	font-size: 24px; margin: 0 auto 14px;
}
.c2f-cat-infocard h3 { text-align: center; color: var(--cc-primary); margin: 0 0 14px; font-size: 17px; }
.c2f-cat-infocard p { font-size: 14px; margin: 0 0 10px; }
.c2f-cat-infocard ul { margin: 0 0 10px; padding-left: 20px; font-size: 14px; }
.c2f-cat-infocard li { margin-bottom: 8px; }
.c2f-cat-infocard ul.is-check { list-style: none; padding-left: 0; }
.c2f-cat-infocard ul.is-check li { display: flex; gap: 8px; }
.c2f-cat-infocard ul.is-check li::before { content: "✔"; color: var(--cc-accent-dark); flex-shrink: 0; }

/* Colonne de droite */
.c2f-cat-sidebar { background: var(--cc-card); border-radius: var(--cc-radius); box-shadow: var(--cc-shadow); padding: 24px; position: sticky; top: 20px; }
.c2f-cat-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--cc-border); font-size: 14px; }
.c2f-cat-row span:first-child { color: var(--cc-muted); }
.c2f-cat-row span:last-child { text-align: right; }
.c2f-cat-row.is-price span:last-child,
.c2f-cat-row.is-satisfaction span:last-child { font-weight: 700; color: var(--cc-accent-dark); }

.c2f-cat-btn {
	display: block;
	width: 100%;
	margin-top: 12px;
	padding: 13px;
	background: var(--cc-accent);
	color: #fff;
	border: 1px solid var(--cc-accent);
	border-radius: 8px;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	text-align: center;
	transition: background .15s, color .15s;
}
.c2f-cat-btn:hover { background: var(--cc-accent-dark); border-color: var(--cc-accent-dark); }
.c2f-cat-btn.is-outline { background: none; color: var(--cc-primary); border-color: var(--cc-primary); font-size: 14px; padding: 10px; font-weight: 600; }
.c2f-cat-btn.is-outline:hover { background: var(--cc-primary); color: #fff; }
.c2f-cat-btn:disabled { opacity: .6; cursor: wait; }

/* ---------- Fenêtres de demande ---------- */
body.c2f-cat-modal-open { overflow: hidden; }
.c2f-cat-modal {
	position: fixed; inset: 0; z-index: 9999;
	background: rgba(10, 30, 35, .55);
	display: flex; align-items: flex-start; justify-content: center;
	padding: 24px 16px; overflow-y: auto;
}
.c2f-cat-modal[hidden] { display: none; }
.c2f-cat-modal-box { position: relative; background: #fff; border-radius: var(--cc-radius); padding: 28px; width: 100%; max-width: 460px; margin: auto; box-shadow: var(--cc-shadow-hover); }
.c2f-cat-modal-box h3 { margin: 0; color: var(--cc-primary); }
.c2f-cat-modal-sub { color: var(--cc-muted); font-size: 14px; margin: 4px 0 16px; }
.c2f-cat-modal-close { position: absolute; top: 12px; right: 14px; background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--cc-muted); padding: 4px 8px; }

.c2f-cat-field { margin-bottom: 14px; }
.c2f-cat-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--cc-muted); }
.c2f-cat-field input, .c2f-cat-field textarea {
	width: 100%; padding: 10px; border: 1px solid var(--cc-border); border-radius: 6px;
	font: inherit; font-size: 14px; background: #fff; color: var(--cc-text);
}
.c2f-cat-field textarea { min-height: 90px; resize: vertical; }
.c2f-cat-estimation { font-weight: 600; color: var(--cc-accent-dark); margin: 0 0 6px; }
.c2f-cat-status { margin-top: 10px; font-size: 14px; }
.c2f-cat-status.is-success { color: var(--cc-success); }
.c2f-cat-status.is-error { color: #c0392b; }
.c2f-cat-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
	.c2f-cat-layout, .c2f-cat-detail { grid-template-columns: 1fr; }
	.c2f-cat-filters, .c2f-cat-sidebar { position: static; }
	.c2f-cat-infocards { grid-template-columns: 1fr; }
	.c2f-cat-detail-main { padding: 22px; }
}
