/*
 * Single funded_project — card-based vertical flow.
 *   TOPBAR (breadcrumb) → CARD info → CARD about (logo + descrizione) → CONSORZIO partners
 * Palette: Avada Global Options CSS vars (see /docs/palette.md).
 * Visual goal: clean, premium, "scheda di progetto" feel.
 */

/* Hide Avada's default page-title-bar — the topbar/breadcrumb replaces it. The DOM stays
   intact so Avada sticky-header logic isn't disturbed. */
body.sefp-funded-project .avada-page-titlebar-wrapper { display: none; }
body.sefp-funded-project #post-area { padding-top: 0; }
body.sefp-funded-project #content { padding: 0 !important; max-width: none !important; width: 100% !important; }
body.sefp-funded-project .sefp-single { margin: 0 !important; }

.sefp-single {
	color: var(--awb-color-6, #4a4e57);
	background: var(--awb-color-2, #f9f9fb);
}

.sefp-container {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 24px;
}

.sefp-section {
	padding: 40px 0;
	position: relative;
}

.sefp-section--info     { background: var(--awb-color-2, #f9f9fb); padding: 48px 0 32px; }
.sefp-section--about    { background: var(--awb-color-2, #f9f9fb); padding: 32px 0 48px; }
.sefp-section--partners { background: var(--awb-color-7, #212934); color: var(--awb-color-1, #ffffff); padding: 80px 0; }

/* ─── TOPBAR ──────────────────────────────────────────────────────── */

.sefp-topbar {
	background: var(--awb-color-1, #ffffff);
	border-bottom: 1px solid var(--awb-color-4, #e2e2e2);
	padding: 18px 0;
}
.sefp-crumb {
	font-size: 0.88rem;
	letter-spacing: 0.02em;
	color: var(--awb-color-6, #4a4e57);
	text-decoration: none;
	transition: color 150ms ease;
}
.sefp-crumb:hover { color: var(--awb-color-5, #009fe3); }

/* ─── CARD BASE ───────────────────────────────────────────────────── */

.sefp-card {
	background: var(--awb-color-1, #ffffff);
	border-radius: 16px;
	overflow: hidden;
	box-shadow:
		0 24px 48px -12px rgba(33, 41, 52, 0.12),
		0 4px 12px rgba(33, 41, 52, 0.05);
	position: relative;
}

/* ─── CARD 1 — LOGO (1/4) + INFO (3/4) ────────────────────────────── */

/* Colored accent bar at the top of the info card */
.sefp-card--info::before {
	content: "";
	display: block;
	height: 6px;
	background: var(--awb-color-5, #009fe3);
}
.sefp-card--regional::before { background: linear-gradient(90deg, var(--awb-color-custom-10, #65bc7b), color-mix(in srgb, var(--awb-color-custom-10, #65bc7b) 70%, var(--awb-color-5, #009fe3))); }
.sefp-card--national::before { background: linear-gradient(90deg, var(--awb-color-7, #212934), var(--awb-color-5, #009fe3)); }
.sefp-card--eu::before       { background: linear-gradient(90deg, var(--awb-color-5, #009fe3), var(--awb-color-custom-10, #65bc7b)); }

.sefp-card-info__layout {
	display: grid;
	grid-template-columns: 1fr 3fr;
	gap: 0;
	align-items: stretch;
}

.sefp-card-info__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 36px 28px;
	background: var(--awb-color-2, #f9f9fb);
	border-right: 1px solid var(--awb-color-4, #e2e2e2);
}
.sefp-card-info__logo img {
	max-width: 100%;
	max-height: 200px;
	width: auto;
	height: auto;
	object-fit: contain;
}
.sefp-card-info__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 120px;
	height: 120px;
	border-radius: 50%;
	background: var(--awb-color-1, #ffffff);
	border: 2px solid var(--awb-color-4, #e2e2e2);
	color: var(--awb-color-7, #212934);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-weight: 700;
	font-size: 1.5rem;
	letter-spacing: 0.04em;
}

.sefp-card-info__main {
	display: flex;
	flex-direction: column;
	min-width: 0; /* let inner grid shrink without overflow */
}

.sefp-card-info__head {
	padding: 32px 36px 26px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	border-bottom: 1px solid var(--awb-color-4, #e2e2e2);
}

.sefp-card-info__title {
	margin: 0;
	font-size: clamp(1.7rem, 3.2vw, 2.4rem);
	line-height: 1.12;
	font-weight: 800;
	color: var(--awb-color-7, #212934);
	letter-spacing: -0.01em;
}

/* Acronym expansion / descriptive title — sits between the H1 (post title /
   acronym) and the programme line. Larger and warmer than the programme
   caption: it's a real piece of editorial copy, not metadata. */
.sefp-card-info__subtitle {
	margin: 0;
	font-size: clamp(1rem, 1.4vw, 1.15rem);
	line-height: 1.45;
	font-weight: 500;
	color: var(--awb-color-6, #4a4e57);
	font-style: italic;
	max-width: 760px;
}

.sefp-card-info__programme {
	margin: 0;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--awb-color-6, #4a4e57);
	max-width: 860px;
}

/* Pill-style "Sito del progetto ↗" link sitting in the heading card. Replaces
   the bottom CTA strip — scanners read top-to-bottom and we want the primary
   external action visible immediately, not after the dossier grid. */
.sefp-card-info__website-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 6px;
	padding: 8px 18px;
	background: rgba(0, 159, 227, 0.08);
	color: var(--awb-color-5, #009fe3);
	border: 1px solid rgba(0, 159, 227, 0.32);
	border-radius: 999px;
	font-size: 0.92rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 200ms ease, border-color 200ms ease, color 200ms ease, gap 200ms ease, transform 150ms ease;
}
.sefp-card-info__website-link:hover {
	background: var(--awb-color-5, #009fe3);
	border-color: var(--awb-color-5, #009fe3);
	color: var(--awb-color-1, #ffffff);
	gap: 12px;
	transform: translateY(-1px);
	box-shadow: 0 8px 18px rgba(0, 159, 227, 0.25);
}

/* Badge (uppercase pill, funding-source coded) */
.sefp-badge {
	display: inline-block;
	padding: 5px 14px;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	border-radius: 999px;
	background: var(--awb-color-5, #009fe3);
	color: var(--awb-color-1, #ffffff);
	box-shadow: 0 4px 14px rgba(0, 159, 227, 0.18);
}
.sefp-badge--eu       { background: var(--awb-color-5, #009fe3); }
.sefp-badge--national { background: var(--awb-color-7, #212934); }
.sefp-badge--regional { background: var(--awb-color-custom-10, #65bc7b); box-shadow: 0 4px 14px rgba(101, 188, 123, 0.18); }

/* 3-column info grid (timeline, identificativo, budget) */
.sefp-card-info__grid {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 0;
}
.sefp-cell {
	padding: 28px 32px;
	border-right: 1px solid var(--awb-color-4, #e2e2e2);
}
.sefp-cell:last-child { border-right: none; }

.sefp-cell__label {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--awb-color-custom-17, #9ea0a4);
	margin-bottom: 14px;
}

.sefp-cell__big {
	font-size: 1.4rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--awb-color-7, #212934);
	margin-bottom: 6px;
}
.sefp-cell__big code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 1.05rem;
	background: var(--awb-color-3, #f2f3f5);
	padding: 2px 10px;
	border-radius: 6px;
}

.sefp-cell__sub {
	font-size: 0.92rem;
	color: var(--awb-color-6, #4a4e57);
	line-height: 1.45;
}
.sefp-cell__sub strong { color: var(--awb-color-7, #212934); }
.sefp-cell__sub--spaced { margin-top: 10px; }
.sefp-cell__sub--muted  { color: var(--awb-color-custom-17, #9ea0a4); font-style: italic; }

/* Mini timeline visualization */
.sefp-timeline {
	display: flex;
	align-items: center;
	gap: 0;
	margin: 8px 0 12px;
}
.sefp-tl-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	min-width: 0;
}
.sefp-tl-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--awb-color-5, #009fe3);
	box-shadow: 0 0 0 4px rgba(0, 159, 227, 0.18);
}
.sefp-tl-dot--end {
	background: var(--awb-color-custom-10, #65bc7b);
	box-shadow: 0 0 0 4px rgba(101, 188, 123, 0.18);
}
.sefp-tl-line {
	flex: 1;
	height: 2px;
	background: linear-gradient(90deg, var(--awb-color-5, #009fe3), var(--awb-color-custom-10, #65bc7b));
	margin: 0 8px 18px;
}
.sefp-tl-text {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--awb-color-7, #212934);
	white-space: nowrap;
}

/* (Bottom CTA strip removed — the project site link now lives as a pill in
   the heading. .sefp-cta-link is kept for use by other places, e.g. the
   "Torna a tutti i progetti" link in the empty-state of the archive.) */
.sefp-cta-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
	font-size: 1rem;
	color: var(--awb-color-5, #009fe3);
	text-decoration: none;
	transition: gap 200ms ease;
}
.sefp-cta-link:hover { gap: 16px; color: var(--awb-color-7, #212934); }

/* ─── CARD 2 — DESCRIZIONE (single column, full width) ────────────── */

.sefp-card--about {
	padding: 36px 40px 40px;
}
.sefp-card--about > .sefp-h2 {
	margin-bottom: 20px;
}

/* ─── SECTION TITLES ──────────────────────────────────────────────── */

.sefp-h2 {
	margin: 0 0 24px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.sefp-h2 h2 {
	margin: 0;
	font-size: clamp(1.4rem, 2.4vw, 1.9rem);
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--awb-color-7, #212934);
	display: inline-flex;
	align-items: center;
	gap: 16px;
}
.sefp-h2 h2::after {
	content: "";
	flex: 0 0 48px;
	height: 4px;
	background: var(--awb-color-5, #009fe3);
	border-radius: 2px;
}
.sefp-h2__sub {
	margin: 0;
	font-size: 0.95rem;
	color: var(--awb-color-custom-17, #9ea0a4);
}
.sefp-h2--light h2       { color: var(--awb-color-1, #ffffff); }
.sefp-h2--light h2::after { background: var(--awb-color-5, #009fe3); }
.sefp-h2--light .sefp-h2__sub { color: rgba(255, 255, 255, 0.65); }

.sefp-h2--centered {
	align-items: center;
	text-align: center;
	margin-bottom: 32px;
}
.sefp-h2--centered h2 { justify-content: center; }
.sefp-h2--centered h2::after { display: none; }

/* ─── BODY (DESCRIZIONE) ──────────────────────────────────────────── */

.sefp-body {
	font-size: 1.04rem;
	line-height: 1.7;
	color: var(--awb-color-6, #4a4e57);
}
.sefp-body > :first-child { margin-top: 0; }
.sefp-body > :last-child  { margin-bottom: 0; }
.sefp-body h2, .sefp-body h3 {
	color: var(--awb-color-7, #212934);
	margin-top: 28px;
}
.sefp-body a {
	color: var(--awb-color-5, #009fe3);
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}
.sefp-body strong { color: var(--awb-color-7, #212934); }

/* ─── CONSORZIO / PARTNER CARDS ───────────────────────────────────── */

.sefp-partners-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 20px;
}

.sefp-partner-card {
	margin: 0;
	padding: 0;
	background: var(--awb-color-1, #ffffff);
	border-radius: 14px;
	overflow: hidden;
	transition: transform 220ms ease, box-shadow 220ms ease;
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}
.sefp-partner-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 18px 36px -12px rgba(0, 0, 0, 0.45);
}

.sefp-partner-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.sefp-partner-card__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 130px;
	padding: 24px;
	background: var(--awb-color-1, #ffffff);
	border-bottom: 1px solid var(--awb-color-4, #e2e2e2);
}
.sefp-partner-card__logo img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	filter: grayscale(35%);
	transition: filter 220ms ease;
}
.sefp-partner-card:hover .sefp-partner-card__logo img { filter: grayscale(0%); }

.sefp-partner-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--awb-color-3, #f2f3f5);
	color: var(--awb-color-7, #212934);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-weight: 700;
	font-size: 1.1rem;
	letter-spacing: 0.04em;
}

.sefp-partner-card__body {
	padding: 16px 20px 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.sefp-partner-card__name {
	font-size: 1rem;
	font-weight: 700;
	color: var(--awb-color-7, #212934);
	line-height: 1.3;
}

.sefp-partner-card__role {
	font-size: 0.82rem;
	font-weight: 500;
	line-height: 1.35;
	color: var(--awb-color-custom-17, #9ea0a4);
	letter-spacing: 0.02em;
	margin-top: -2px;
}

.sefp-partner-card__visit {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--awb-color-5, #009fe3);
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: auto;
	transition: gap 200ms ease;
}
.sefp-partner-card__link:hover .sefp-partner-card__visit { gap: 10px; }

/* ─── CONTATTACI (final section, only when CF7 in body) ───────────── */

/* Dark theme to match Consorzio rhythm AND because the site-global CF7
   styles (.input-contactform / .send-contactform) were authored for a
   blue Fusion column with white text, white borders, white placeholders
   and an outlined button — those whites are invisible on a light card
   but read perfectly on this dark section. We override only what's
   needed to align with the dark backdrop; the rest of the form's native
   look (pill inputs, "INVIA" button) is preserved by design. */

.sefp-section--contact {
	background:
		radial-gradient(1000px 500px at 80% 0%, rgba(0, 159, 227, 0.18), transparent 60%),
		radial-gradient(800px 400px at 0% 100%, rgba(101, 188, 123, 0.08), transparent 60%),
		linear-gradient(160deg, var(--awb-color-7, #212934) 0%, var(--awb-color-custom-13, #26303e) 100%);
	color: var(--awb-color-1, #ffffff);
	padding: 80px 0 96px;
}
.sefp-section--contact .sefp-h2 h2     { color: var(--awb-color-1, #ffffff); }
.sefp-section--contact .sefp-h2__sub   { color: rgba(255, 255, 255, 0.70); }

.sefp-contact-card {
	max-width: 760px;
	margin: 0 auto;
	background: transparent;
	padding: 0;
	box-shadow: none;
}
.sefp-contact-card .wpcf7-form { margin: 0; }
.sefp-contact-card p { margin: 0 0 14px; }

/* Inputs on dark backdrop — semi-transparent white surface, white text
   (forced via -webkit-text-fill-color which the original global rule sets),
   subtle border that lights up on focus. !important targets ONLY color
   properties: necessary because the site's global .input-contactform rule
   uses !important to lock white-on-blue, which would still hide typed text
   on this dark surface (text would be white but our scope can't otherwise
   un-override an !important from a less-specific selector). */
.sefp-contact-card .input-contactform,
.sefp-contact-card .wpcf7-form-control:not(.wpcf7-submit) {
	background: rgba(255, 255, 255, 0.06);
	color: var(--awb-color-1, #ffffff) !important;
	-webkit-text-fill-color: var(--awb-color-1, #ffffff) !important;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 999px;
	padding: 12px 22px;
	font-size: 0.95rem;
	width: 100%;
	box-sizing: border-box;
	transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.sefp-contact-card .space-text-area,
.sefp-contact-card textarea.wpcf7-form-control {
	border-radius: 16px;
	min-height: 140px;
	padding: 14px 22px;
	resize: vertical;
}
.sefp-contact-card .input-contactform::placeholder,
.sefp-contact-card .wpcf7-form-control::placeholder {
	color: rgba(255, 255, 255, 0.55) !important;
	-webkit-text-fill-color: rgba(255, 255, 255, 0.55) !important;
	opacity: 1;
}
.sefp-contact-card .input-contactform:focus,
.sefp-contact-card .wpcf7-form-control:not(.wpcf7-submit):focus {
	background: rgba(255, 255, 255, 0.10);
	border-color: var(--awb-color-5, #009fe3);
	box-shadow: 0 0 0 4px rgba(0, 159, 227, 0.25);
	outline: none;
}

/* Autofill — Chrome/Safari paint a yellow box and force black text. We
   override both via inset shadow + text-fill-color so autofill stays on
   theme. */
.sefp-contact-card .input-contactform:-webkit-autofill,
.sefp-contact-card .wpcf7-form-control:-webkit-autofill {
	-webkit-box-shadow: 0 0 0 1000px rgba(33, 41, 52, 0.85) inset !important;
	-webkit-text-fill-color: var(--awb-color-1, #ffffff) !important;
	caret-color: var(--awb-color-1, #ffffff);
	border: 1px solid rgba(255, 255, 255, 0.22) !important;
}

/* Submit button — site-global .send-contactform locks background with
   !important (it was meant to render an outlined button on a blue Fusion
   column), so we must use !important on background AND border too,
   otherwise the default state stays transparent/white-on-white and the
   button is only legible when our hover swaps it. White text in both
   states; hover darkens the fill instead of inverting to white-on-dark. */
.sefp-contact-card .send-contactform,
.sefp-contact-card .wpcf7-submit {
	background: var(--awb-color-5, #009fe3) !important;
	color: var(--awb-color-1, #ffffff) !important;
	-webkit-text-fill-color: var(--awb-color-1, #ffffff) !important;
	border: 1px solid var(--awb-color-5, #009fe3) !important;
	border-radius: 999px;
	padding: 12px 36px;
	font-weight: 700;
	font-size: 0.92rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 200ms ease, border-color 200ms ease, transform 150ms ease, box-shadow 200ms ease;
	box-shadow: 0 8px 22px rgba(0, 159, 227, 0.35);
	width: auto;
}
.sefp-contact-card .send-contactform:hover,
.sefp-contact-card .wpcf7-submit:hover {
	background: var(--awb-color-custom-13, #26303e) !important;
	border-color: var(--awb-color-custom-13, #26303e) !important;
	color: var(--awb-color-1, #ffffff) !important;
	-webkit-text-fill-color: var(--awb-color-1, #ffffff) !important;
	transform: translateY(-1px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.30);
}

/* Two-column layout helpers used by the original form template */
.sefp-contact-card .one_half {
	display: inline-block;
	width: calc(50% - 8px);
	vertical-align: top;
	margin-right: 12px;
	margin-bottom: 4px;
}
.sefp-contact-card .one_half:nth-of-type(2n),
.sefp-contact-card .one_half.last { margin-right: 0; }
.sefp-contact-card .allineamento-destro { text-align: right; margin-top: 6px; }

.sefp-contact-card .wpcf7-not-valid-tip {
	display: block;
	color: #ff7e7e;
	font-size: 0.85rem;
	margin: 6px 14px 0;
}
.sefp-contact-card .wpcf7-response-output {
	margin: 16px 0 0;
	border-radius: 12px;
	padding: 12px 16px;
	border-color: rgba(255, 255, 255, 0.20);
	color: rgba(255, 255, 255, 0.9);
}

/* ─── TABLET (≤1024px) ────────────────────────────────────────────── */

@media (max-width: 1024px) {
	.sefp-section { padding: 32px 0; }
	.sefp-section--info { padding: 36px 0 24px; }
	.sefp-section--about { padding: 24px 0 36px; }
	.sefp-section--partners { padding: 64px 0; }
	.sefp-section--contact { padding: 64px 0 80px; }

	.sefp-card-info__layout { grid-template-columns: 1fr 2.5fr; }
	.sefp-card-info__logo { padding: 28px 22px; }
	.sefp-card-info__logo img { max-height: 160px; }
	.sefp-card-info__head { padding: 26px 28px 22px; }
	.sefp-card-info__grid { grid-template-columns: 1fr 1fr; }
	.sefp-cell { padding: 22px 28px; }
	.sefp-cell:nth-child(2) { border-right: none; }
	.sefp-cell:nth-child(3) {
		grid-column: span 2;
		border-top: 1px solid var(--awb-color-4, #e2e2e2);
	}

	.sefp-card--about { padding: 28px 30px 32px; }
	.sefp-contact-card { padding: 32px 32px; }
}

/* ─── MOBILE (≤640px) ─────────────────────────────────────────────── */

@media (max-width: 640px) {
	.sefp-container { padding: 0 18px; }
	.sefp-topbar { padding: 14px 0; }

	.sefp-section { padding: 24px 0; }
	.sefp-section--info { padding: 28px 0 16px; }
	.sefp-section--about { padding: 16px 0 28px; }
	.sefp-section--partners { padding: 48px 0; }
	.sefp-section--contact { padding: 48px 0 64px; }

	.sefp-card { border-radius: 12px; }

	.sefp-card-info__layout { grid-template-columns: 1fr; }
	.sefp-card-info__logo {
		padding: 24px;
		border-right: none;
		border-bottom: 1px solid var(--awb-color-4, #e2e2e2);
	}
	.sefp-card-info__logo img { max-height: 130px; }
	.sefp-card-info__placeholder { width: 96px; height: 96px; font-size: 1.2rem; }

	.sefp-card-info__head {
		padding: 22px 22px 20px;
		gap: 10px;
	}
	.sefp-card-info__title { font-size: clamp(1.4rem, 7vw, 1.7rem); }
	.sefp-card-info__grid { grid-template-columns: 1fr; }
	.sefp-cell {
		border-right: none;
		border-bottom: 1px solid var(--awb-color-4, #e2e2e2);
		padding: 22px;
	}
	.sefp-cell:nth-child(3) {
		grid-column: auto;
		border-top: none;
	}
	.sefp-cell:last-child { border-bottom: none; }

	.sefp-card--about { padding: 24px 22px 28px; }
	.sefp-contact-card { padding: 24px 22px; border-radius: 14px; }

	.sefp-h2 { margin-bottom: 20px; }
	.sefp-h2 h2::after { flex-basis: 32px; }
	.sefp-partners-grid {
		grid-template-columns: 1fr 1fr;
		gap: 14px;
	}
	.sefp-partner-card__logo { height: 100px; padding: 18px; }
}
