/* Projects page «سایر پروژه‌ها» — Figma 687:1165. Three photo cards a row (308px); the hovered card widens to Figma's
   571 (others 320 at 1440) and turns to colour, as the wide colour card in the design shows. */
.wp-block-post-content > .scico-projects-grid { margin-block-start: 0; }

.scico-projects-grid { box-sizing: border-box; margin-block-start: 0; padding: 40px 96px 96px; background: #fff; }
.scico-projects-grid[hidden] { display: none; }
/* Right under the featured row (which ends with 96px) the heading starts 104px below its cards. */
.scico-projects-featured:not([hidden]) + .scico-projects-grid { padding-top: 8px; }
/* Project page «پروژه‌های مشابه»: same 104px rhythm as the sections above (their 96 + 8). */
.wp-block-post-content > .scico-projects-grid.is-similar { padding-top: 8px; }
.scico-projects-grid__inner { display: flex; width: min(100%, var(--projects-grid-contentWidth, 1248px)); flex-direction: column; margin-inline: auto; }
.scico-projects-grid__heading { margin: 0 0 32px; color: var(--projects-grid-headingColor, #000); font-size: var(--projects-grid-headingSize, 32px); font-weight: var(--projects-grid-headingWeight, 800); line-height: 1.45; text-align: right; }

/* Basis 25% keeps three cards a line; growing one card to 36 shares the spare width as 571/320/320 in Figma. */
.scico-projects-grid__list { display: flex; flex-wrap: wrap; gap: 20px; margin: 0; padding: 0; list-style: none; }
.scico-projects-grid__card { position: relative; display: flex; min-width: 0; height: var(--projects-grid-cardHeight, 308px); box-sizing: border-box; flex: 1 1 25%; flex-direction: column; justify-content: space-between; margin: 0; padding: 16px; overflow: hidden; border-radius: 8px; background: #2d2e2c; color: #fff; isolation: isolate; }
.scico-projects-grid__card[hidden] { display: none; }

.scico-projects-grid__image { position: absolute; inset: 0; z-index: -2; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.scico-projects-grid.is-grayscale .scico-projects-grid__image { filter: grayscale(1); }
/* Figma: a dark fade over the lower part with a 4px background blur that follows the fade. */
.scico-projects-grid__shade { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(177deg, rgb(0 0 0 / 0%) 42%, rgb(0 0 0 / 62%) 98%); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); -webkit-mask-image: linear-gradient(to bottom, transparent 48%, #000 92%); mask-image: linear-gradient(to bottom, transparent 48%, #000 92%); }
/* Figma's hover card darkens from the top down instead. */
.scico-projects-grid__shade.is-hover { background: linear-gradient(178deg, rgb(0 0 0 / 4%) 3%, rgb(0 0 0 / 52%) 98%); opacity: 0; -webkit-backdrop-filter: none; backdrop-filter: none; -webkit-mask-image: none; mask-image: none; }

.scico-projects-grid__status { align-self: flex-end; padding: 4px 8px; border-radius: 4px; background: rgb(0 0 0 / 32%); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); font-size: 11px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.scico-projects-grid__body { display: flex; min-width: 0; flex-direction: column; gap: 8px; margin-top: auto; }
.scico-projects-grid__row { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; }
.scico-projects-grid__title { min-width: 0; margin: 0; overflow: hidden; color: #fff; font-size: var(--projects-grid-titleSize, 17px); font-weight: var(--projects-grid-titleWeight, 800); line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.scico-projects-grid__service { flex: 0 0 auto; padding: 3px 8px; border: 1px solid #fff; border-radius: 4px; background: rgb(0 0 0 / 32%); font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap; transition: background-color 300ms ease; }
.scico-projects-grid__meta { font-size: var(--projects-grid-metaSize, 14px); font-weight: 600; line-height: 1.5; white-space: nowrap; }
.scico-projects-grid__footer { display: flex; justify-content: flex-end; padding-top: 8px; border-top: 1px solid rgb(255 255 255 / 50%); }
.scico-projects-grid__details { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 13px; font-weight: 600; line-height: 1.5; text-decoration: none; }
a.scico-projects-grid__details::after { position: absolute; inset: 0; z-index: 1; content: ""; }
a.scico-projects-grid__details:focus-visible { outline: none; }
.scico-projects-grid__card:has(a.scico-projects-grid__details:focus-visible) { outline: 2px solid #4c504a; outline-offset: 3px; }
/* Figma arrow-left-02 (white): the 8×12 SVG turned with rotate(-90) scaleX(-1) inside a 16px frame. */
.scico-projects-grid__arrow { display: flex; width: 16px; height: 16px; flex: 0 0 auto; align-items: center; justify-content: center; }
.scico-projects-grid__arrow img { display: block; transform: rotate(-90deg) scaleX(-1); }

.scico-projects-grid__more { display: inline-flex; height: 48px; box-sizing: border-box; align-items: center; align-self: center; gap: 12px; margin: 40px 0 0; padding: 0 20px; border: 0; border-radius: 8px; background: var(--projects-grid-buttonBackground, #4c504a); color: var(--projects-grid-buttonColor, #fff); cursor: pointer; font: inherit; font-size: 16px; font-weight: 500; line-height: 1.5; transition: background-color 200ms ease; }
.scico-projects-grid__more[hidden] { display: none; }
.scico-projects-grid__more img { display: block; margin-inline: 8px; transition: transform 300ms ease; }
.scico-projects-grid__more:focus-visible { outline: 2px solid var(--projects-grid-buttonBackground, #4c504a); outline-offset: 3px; }

/* Hover and keyboard focus: widen (rows of three), colour, darker fade, light service tag, arrow nudges forward. */
.scico-projects-grid__card { transition: flex-grow 450ms cubic-bezier(.2, .7, .2, 1); }
.scico-projects-grid__image { transition: filter 500ms ease, transform 700ms cubic-bezier(.2, .7, .2, 1); }
.scico-projects-grid__shade.is-hover { transition: opacity 400ms ease; }
.scico-projects-grid__arrow { transition: transform 300ms ease; }
.scico-projects-grid.is-grayscale .scico-projects-grid__card:has(a:focus-visible) .scico-projects-grid__image { filter: grayscale(0); }
.scico-projects-grid.is-expanding .scico-projects-grid__card:has(a:focus-visible) { flex-grow: 36; }
@media (hover: hover) {
	.scico-projects-grid.is-expanding .scico-projects-grid__card:hover { flex-grow: 36; }
	.scico-projects-grid.is-grayscale .scico-projects-grid__card:hover .scico-projects-grid__image { filter: grayscale(0); }
	.scico-projects-grid__card:hover .scico-projects-grid__image { transform: scale(1.03); }
	.scico-projects-grid__card:hover .scico-projects-grid__shade.is-hover { opacity: 1; }
	.scico-projects-grid__card:hover .scico-projects-grid__service { background: rgb(255 255 255 / 30%); }
	.scico-projects-grid__card:hover .scico-projects-grid__arrow { transform: translateX(-4px); }
	.scico-projects-grid__more:hover { background: color-mix(in srgb, var(--projects-grid-buttonBackground, #4c504a) 85%, #000); }
	.scico-projects-grid__more:hover img { transform: translateX(-3px); }
}
@media (prefers-reduced-motion: reduce) {
	.scico-projects-grid__card,
	.scico-projects-grid__image,
	.scico-projects-grid__shade.is-hover,
	.scico-projects-grid__arrow,
	.scico-projects-grid__more img { transition: none; }
	.scico-projects-grid__card:hover .scico-projects-grid__image,
	.scico-projects-grid__card:hover .scico-projects-grid__arrow,
	.scico-projects-grid__more:hover img { transform: none; }
}

@media (max-width: 1100px) {
	.scico-projects-grid { padding: 32px 32px 80px; }
	.scico-projects-grid__heading { font-size: min(var(--projects-grid-headingSize, 32px), 28px); }
	.scico-projects-grid__list { gap: 16px; }
	/* Two a row; the three similar projects stay on one row while they fit. */
	.scico-projects-grid__card { flex-basis: 40%; }
	.scico-projects-grid.is-similar .scico-projects-grid__card { flex-basis: 25%; }
}
/* Narrow screens: similar projects become one swipeable row (snapping card by card) with the next card peeking in. */
@media (max-width: 760px) {
	.scico-projects-grid.is-similar .scico-projects-grid__list { flex-wrap: nowrap; margin-inline: -32px; padding-inline: 32px; overflow-x: auto; scroll-padding-inline: 32px; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.scico-projects-grid.is-similar .scico-projects-grid__list::-webkit-scrollbar { display: none; }
	.scico-projects-grid.is-similar .scico-projects-grid__card { flex: 0 0 46%; scroll-snap-align: start; }
	.scico-projects-grid.is-similar .scico-projects-grid__card:only-child { flex-basis: 100%; }
}

@media (max-width: 600px) {
	.scico-projects-grid { padding: 24px 16px 64px; }
	.scico-projects-grid__status { font-size: 12px; }
	.scico-projects-featured:not([hidden]) + .scico-projects-grid,
	.wp-block-post-content > .scico-projects-grid.is-similar { padding-top: 0; }
	.scico-projects-grid__heading { margin-bottom: 20px; font-size: min(var(--projects-grid-headingSize, 32px), 24px); }
	.scico-projects-grid__list { gap: 12px; }
	.scico-projects-grid__card { height: min(var(--projects-grid-cardHeight, 308px), 280px); flex-basis: 100%; padding: 14px; }
	.scico-projects-grid.is-similar .scico-projects-grid__list { margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
	.scico-projects-grid.is-similar .scico-projects-grid__card { flex-basis: 84%; }
	.scico-projects-grid__title { font-size: min(var(--projects-grid-titleSize, 17px), 16px); }
	.scico-projects-grid__more { align-self: stretch; justify-content: center; margin-top: 28px; font-size: 15px; }
}
