/* ==========================================================================
   Acasă / Home — homepage-only layout & decoration.
   Colors/fonts/most spacing come from theme.json presets via block attrs;
   rules below are grid patterns, image treatment and the handful of
   pixel/clamp values that fall outside the theme.json spacing scale
   (flagged in the implementer report).
   ========================================================================== */

/* Shared inline "label →" links (Vezi toate serviciile, Povestea completă, Toate articolele) */
.fi-link-arrow a {
	color: var(--wp--preset--color--deep);
	text-decoration: none;
	border-bottom: 1px solid var(--wp--preset--color--accent);
	padding-bottom: 3px;
}

.fi-link-arrow a:hover {
	color: var(--wp--preset--color--ink);
}

.fi-service-more a,
.fi-service-more a:hover {
	color: var(--wp--preset--color--deep);
	text-decoration: none;
}

/* Hero — second fade-in tier (image column), delayed vs .fi-fade-up */
.fi-fade-up-delay {
	opacity: 0;
	animation: fiUp 0.8s var(--fi-dur-fast) var(--fi-ease) both;
}

.fi-hero-text {
	display: flex;
	flex-direction: column;
	gap: 26px;
}

/* Hero eyebrow line-height fix: moved to assets/css/patterns.css
   (.fi-hero-text .fi-eyebrow, grouped with the same fix used on other
   pages' header wrappers). */

/* NOTE: the WP default block-gap leak (24px margin-block-start on
   is-layout-flow/is-layout-constrained children) that used to be
   neutralized here with a long homepage-only selector list is now fixed
   globally in style.css (`body:not(.single-post) :where(.is-layout-flow,
   .is-layout-constrained) > *`), which covers every wrapper below plus
   every other page template. Nothing homepage-specific left to do here. */

.fi-hero-sub {
	max-width: 52ch;
}

.fi-hero-cta-row {
	display: flex;
	align-items: center;
	gap: 18px;
	flex-wrap: wrap;
	margin-top: 4px;
}

body.home .fi-hero-cta-row .wp-block-button__link {
	font-size: 15px;
	padding: 15px 28px;
	letter-spacing: 0.15px;
}

/* Credentials line under the hero CTA (last paragraph in .fi-hero-text) */
body.home .fi-hero-text > p:last-child {
	letter-spacing: 0.26px;
}

.fi-hero-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr));
	gap: clamp(36px, 6vw, 84px);
	align-items: center;
}

/* Hero padding is asymmetric in the design (92px top / 76px bottom); the
   spacing-110 preset applied symmetrically on both sides. */
body.home .fi-hero {
	padding-bottom: 76px !important;
}

.fi-portrait-hero {
	border-radius: 22px;
	overflow: hidden;
	background: var(--wp--preset--color--tint);
	box-shadow: 0 28px 64px rgba(var(--fi-shadow-rgb), 0.12);
}

.fi-portrait-hero img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

/* Shared section header row (eyebrow + title [+ "see all" link]) */
.fi-section-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--60);
	flex-wrap: wrap;
	margin-bottom: var(--wp--preset--spacing--80);
}

.fi-section-header__intro,
.fi-section-intro {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.fi-section-intro {
	margin-bottom: var(--wp--preset--spacing--80);
}

/* Reasons band ("Poate ai ajuns aici pentru că…"): the section is alignfull but
   only breaks out to the constrained post-content's 1240px, so the beige band
   floats with ~100px lighter margins instead of spanning the viewport. Force a
   true 100vw full-bleed (same technique as despre's quote band) — the inner
   .fi-reasons-grid stays constrained at 1240 centered. Design band is 758px tall
   (top 958 → bottom 1715); the spacing-120 bottom padding (96px) leaves it 50px
   short, pulling the services H2 up ~46px. */
body.home .fi-band {
	width: 100vw !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	padding-bottom: 146px !important;
}

/* Reasons band left column: H2 is 42px (not the generic 44px section H2),
   with a 28px gap down to the quote (not the shared 14px section-intro gap). */
body.home .fi-band .fi-section-header__intro h2 {
	font-size: 42px;
}

body.home .fi-band .fi-section-header__intro {
	gap: 28px;
}

/* Reasons ("Te regăsești?") */
.fi-quote {
	font-family: var(--wp--preset--font-family--heading);
	font-style: italic;
	font-size: 21px;
	line-height: 1.5;
	max-width: 34ch;
}

.fi-reasons-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
	gap: clamp(36px, 5vw, 72px);
	align-items: start;
}

.fi-reason-row {
	display: grid;
	grid-template-columns: 44px 1fr;
	gap: var(--wp--preset--spacing--20);
	border-top: 1px solid var(--wp--preset--color--line);
	padding: 20px 0;
	margin: 0;
}

.fi-reason-num {
	font-family: var(--wp--preset--font-family--heading);
	font-style: italic;
	font-size: 16px;
	line-height: 1;
	color: var(--wp--preset--color--deep);
	padding-top: 2px;
}

.fi-reason-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: 17px;
	font-weight: 600;
	letter-spacing: -0.005em;
	/* Design box is ~23px (line-height normal); inherited global 1.7
	   line-height over-taxes the row pitch (94px design). */
	line-height: normal;
}

.fi-reason-desc {
	margin: 6px 0 0;
	line-height: 1.65;
}

/* The global block-gap-leak reset (`body:not(.single-post) :where(...) > *`,
   specificity 0,1,1) outranks the plain .fi-reason-desc class above and
   zeroes margin-block-start, silently discarding the 6px margin-top and
   collapsing the row pitch from 94px to ~88px. Re-assert it at higher
   specificity. */
body.home .fi-reason-desc {
	margin-top: 6px;
}

/* Services */
.fi-services-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
	gap: 18px;
	align-items: stretch;
}

body.home section:has(.fi-services-grid) h2 {
	font-size: 42px;
}

/* "Cum lucrăm împreună" (process section): generic section H2s are 42px in
   the design; only the final-CTA H2 stays at the default 44px. ("Articole
   recente" is covered by the .fi-band rule above; "Cum te pot sprijini" by
   the services-grid rule above.) */
body.home .fi-section-intro h2 {
	font-size: 42px;
}

.fi-service-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	text-decoration: none;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 18px;
	padding: 26px;
	transition: transform var(--fi-dur-fast) var(--fi-ease), box-shadow var(--fi-dur-fast) var(--fi-ease), border-color var(--fi-dur-fast) var(--fi-ease);
}

/* Body copy line-height: theme.json global (1.7) renders cards 284px tall;
   design line-height is tighter (1.65 / 23.9px), giving 275px cards. */
.fi-service-card > p:not(.fi-service-more) {
	line-height: 1.65;
}

.fi-service-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 18px 40px rgba(var(--fi-shadow-rgb), 0.08);
	border-color: var(--wp--preset--color--accent);
}

.fi-service-icon {
	width: 38px;
	height: 38px;
	border-radius: 12px;
	background: var(--wp--preset--color--tint);
	display: flex;
	align-items: center;
	justify-content: center;
}

.fi-service-icon__dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--wp--preset--color--deep);
}

.fi-service-more {
	font-weight: 600;
	/* inherited global line-height (1.7) makes this single line ~5px taller
	   than its natural text height in the design. */
	line-height: normal;
}

/* Process */
.fi-process-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
	gap: var(--wp--preset--spacing--70);
	align-items: start;
}

.fi-process-step {
	border-top: 1px solid var(--wp--preset--color--line);
	padding-top: 22px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.fi-process-num {
	font-family: var(--wp--preset--font-family--heading);
	font-style: italic;
	font-size: 30px;
	line-height: 1;
	color: var(--wp--preset--color--deep);
}

/* .fi-confidentiality base rule and .fi-confidentiality__dot moved to
   assets/css/patterns.css (byte-identical duplicates of .fi-resurse-notice
   and .fi-notice-dot in resurse.css). The page-specific overrides below
   stay here. */

body.home .fi-confidentiality {
	padding: 12px 20px;
}

body.home .fi-confidentiality p {
	font-size: 14px !important;
}

/* About */
.fi-about-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
	gap: clamp(36px, 6vw, 80px);
	align-items: center;
}

/* About-teaser text column: the authored 20px blockGap is zeroed by the global
   block-gap-leak reset (margin-block-start:0), collapsing eyebrow/H2/paragraph/
   chips/link to 0px gaps. Restore it as a real flex gap (specificity-proof,
   unlike child margins which lose to the blanket rule). Design H2 is 42px. */
.fi-about-grid > .wp-block-group {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

body.home .fi-about-grid h2 {
	font-size: 42px;
}

.fi-portrait-about {
	border-radius: 20px;
	overflow: hidden;
	background: var(--wp--preset--color--tint);
	max-width: 480px;
}

.fi-portrait-about img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

.fi-about-body {
	max-width: 56ch;
}

.fi-badges-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
}

.fi-badge-pill {
	display: inline-block;
	background: var(--wp--preset--color--tint);
	border-radius: 999px;
	padding: 7px 13px;
	font-weight: 600;
}

body.home .fi-badge-pill {
	font-size: 12.5px;
	line-height: 1.3;
	white-space: nowrap;
}

/* Resources / articles teaser */
.fi-articles-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
	gap: 22px;
	align-items: start;
}

body.home .fi-article-card h3 a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.fi-article-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	text-decoration: none;
	transition: transform var(--fi-dur-fast) var(--fi-ease);
}

.fi-article-card:hover {
	transform: translateY(-4px);
}

.fi-article-thumb {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	border-radius: 14px;
	border: 1px solid var(--wp--preset--color--line);
}

.fi-article-thumb-a {
	background: linear-gradient(135deg, var(--wp--preset--color--wash-a), var(--wp--preset--color--wash-b));
}

.fi-article-thumb-b {
	background: linear-gradient(135deg, var(--wp--preset--color--wash-b), var(--wp--preset--color--tint));
}

.fi-article-thumb-c {
	background: linear-gradient(135deg, var(--wp--preset--color--tint), var(--wp--preset--color--wash-a));
}

.fi-article-meta {
	text-transform: uppercase;
	letter-spacing: 0.15em;
	font-weight: 600;
}

/* Design meta label is 12px / 1.8px tracking. The has-3xs-font-size preset
   (11.5px) never applied — its slug renders hyphenated / 0-specificity :where —
   so the label inherited the ~16.5px medium size. Set it explicitly. */
body.home .fi-article-meta {
	font-size: 12px;
}

/* Homepage "Articole recente" is now a Query Loop that pulls the latest posts
   automatically. core/post-template renders each post as an <li>, so the grid
   class sits on the post-template and the three gradient thumbs cycle by
   position (the static .fi-article-thumb-a/b/c classes can't be set per-item
   inside a loop). */
.fi-articles-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	/* Fixed 3-up so a single real post stays card-sized (top-left) instead of
	   stretching full width the way auto-fit would; collapses on narrow screens. */
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 782px) {
	.fi-articles-grid {
		grid-template-columns: 1fr;
	}
}
.fi-articles-grid > li {
	margin: 0;
}
.fi-articles-grid > li:nth-child(3n + 1) .fi-article-thumb {
	background: linear-gradient(135deg, var(--wp--preset--color--wash-a), var(--wp--preset--color--wash-b));
}
.fi-articles-grid > li:nth-child(3n + 2) .fi-article-thumb {
	background: linear-gradient(135deg, var(--wp--preset--color--wash-b), var(--wp--preset--color--tint));
}
.fi-articles-grid > li:nth-child(3n) .fi-article-thumb {
	background: linear-gradient(135deg, var(--wp--preset--color--tint), var(--wp--preset--color--wash-a));
}
/* meta row: category · reading time */
.fi-article-meta.is-layout-flex {
	align-items: baseline;
	column-gap: 6px;
}
.fi-article-meta .wp-block-post-terms,
.fi-article-meta .wp-block-post-terms a {
	color: inherit;
	text-decoration: none;
}
.fi-article-meta .fi-reading-time::before {
	content: "· ";
}
/* Query-loop post-title / excerpt inherit the card's original type styling. */
.fi-article-card .wp-block-post-title {
	margin: 0;
}
.fi-article-card .wp-block-post-excerpt {
	margin: 0;
}
.fi-article-card .wp-block-post-excerpt__more-text {
	display: none;
}

/* Final CTA */
.fi-cta-box {
	border-radius: 26px;
	padding: clamp(32px, 5vw, 60px);
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
	gap: clamp(28px, 4vw, 56px);
	align-items: center;
}

.fi-portrait-cta {
	border-radius: 18px;
	overflow: hidden;
	background: var(--wp--preset--color--tint);
}

.fi-portrait-cta img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

/* Design: 13px upright helper text next to the CTA button (r5 finding —
   was inheriting 16.5px body size with an authored italic the design lacks). */
.fi-response-note {
	font-style: normal;
	font-size: 13px;
}

.fi-cta-desc {
	max-width: 48ch;
	/* Owner annotation G: the global block-gap reset
	   (style.css: `:where(.is-layout-flow, .is-layout-constrained) > * {
	   margin-block-start: 0 }`) zeroes this paragraph's margin, so it touches
	   the CTA button row directly below. Prototype's final-CTA stack uses a
	   flex column with a 20px gap between the description and the button
	   row — restore that as margin-bottom here. */
	margin-bottom: 20px;
}

/* Design sub-paragraph is 15.5px / 26.35px lh (1.7); the has-small preset
   renders it 14.5px. Bump to 15.5 — line-height follows from the global 1.7. */
body.home .fi-cta-desc {
	font-size: 15.5px !important; /* beats the has-small preset class (!important) */
}

.fi-cta-buttons-row {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

body.home .fi-cta-buttons-row .wp-block-button__link {
	font-size: 14.5px;
	padding: 14px 26px;
}

/* "Articole recente" H2: its intro wrapper is .fi-section-header__intro (not
   .fi-section-intro, which only matches the process section) — r5 finding. */
body.home .fi-section-header__intro h2 {
	font-size: 42px;
}
