/* Project page «اخبار این پروژه» — Figma 687:1405. A rail of news icons joined by 2px lines on the right, then a
   229×132 photo and the date over one line of news. Rows start grey; hovering one (or focusing its link) gives it
   Figma's first-row look: the larger dark icon, a dark-to-grey line and the photo in colour. */
.wp-block-post-content > .scico-project-news { margin-block-start: 0; }

.scico-project-news { --news-icon: 40px; --news-gap: 12px; --news-row-gap: 32px; box-sizing: border-box; margin-block-start: 0; padding: 8px 96px 96px; background: #fff; }
.scico-project-news__inner { display: flex; width: min(100%, var(--project-news-contentWidth, 1248px)); flex-direction: column; gap: 40px; margin-inline: auto; }
.scico-project-news h2 { margin: 0; color: var(--project-news-headingColor, #000); font-size: var(--project-news-headingSize, 32px); font-weight: var(--project-news-headingWeight, 800); line-height: 1.45; text-align: right; }

.scico-project-news__list { display: flex; flex-direction: column; gap: var(--news-row-gap); margin: 0; padding: 0; list-style: none; }
.scico-project-news__item { position: relative; display: grid; grid-template-columns: 100px 229px minmax(0, 1fr); align-items: start; column-gap: 32px; margin: 0; }
.scico-project-news__item.no-image .scico-project-news__body { grid-column: 2 / -1; }

/* Rail: the icon sits at the row's top; the line runs from under it to just above the next row's icon. */
.scico-project-news__rail { position: relative; display: flex; align-self: stretch; justify-content: center; }
.scico-project-news__rail::before,
.scico-project-news__rail::after { position: absolute; top: calc(var(--news-icon) * .8 + var(--news-gap)); bottom: calc(var(--news-gap) - var(--news-row-gap)); left: calc(50% - 1px); width: 2px; content: ""; transition: top 300ms ease, opacity 300ms ease; }
.scico-project-news__rail::after { background: var(--project-news-lineColor, #c0c0c0); }
.scico-project-news__rail::before { z-index: 1; background: linear-gradient(#000, #c8c8c8); opacity: 0; }
.scico-project-news__item:last-child .scico-project-news__rail::before,
.scico-project-news__item:last-child .scico-project-news__rail::after { bottom: 0; }
.scico-project-news__icon { position: relative; width: var(--news-icon); height: var(--news-icon); flex: none; }
/* Figma draws the idle icon at 32px and the active one at 40px: one 40px box scaled to .8 from its top edge. */
.scico-project-news__glyph { position: absolute; inset: 0; transform: scale(.8); transform-origin: 50% 0; transition: transform 300ms ease; }
.scico-project-news__glyph img { position: absolute; top: 9.37%; left: 5.21%; display: block; width: 89.58%; height: 81.26%; max-width: none; transition: opacity 300ms ease; }
.scico-project-news__glyph .is-active { opacity: 0; }

.scico-project-news__media { position: relative; display: block; overflow: hidden; aspect-ratio: 229 / 132; border-radius: 8px; background: #f3efe5; }
.scico-project-news__media img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; transition: filter 400ms ease, transform 700ms cubic-bezier(.2, .7, .2, 1); }
.scico-project-news.is-grayscale .scico-project-news__media img { filter: grayscale(1); }

.scico-project-news__body { display: flex; min-width: 0; flex-direction: column; gap: 12px; text-align: right; }
.scico-project-news__date { margin: 0; color: var(--project-news-dateColor, #000); font-size: var(--project-news-dateSize, 22px); font-weight: var(--project-news-dateWeight, 800); line-height: 1.45; }
.scico-project-news__text { margin: 0; color: var(--project-news-textColor, #000); font-size: var(--project-news-textSize, 18px); font-weight: var(--project-news-textWeight, 400); line-height: 1.8; overflow-wrap: anywhere; }
.scico-project-news__text a { color: inherit; text-decoration: underline; text-underline-offset: 4px; }
.scico-project-news__link { color: inherit; text-decoration: none; }
/* A linked row is one link: the date's link stretches over the whole row. */
.scico-project-news__link::after { position: absolute; z-index: 2; inset: -8px; border-radius: 10px; content: ""; }
.scico-project-news__link:focus { outline: none; }
.scico-project-news__link:focus-visible::after { outline: 2px solid #4c504a; outline-offset: 2px; }

/* Active row: hover with a mouse, or keyboard focus on its link. */
.scico-project-news__item:focus-within .scico-project-news__glyph { transform: scale(1); }
.scico-project-news__item:focus-within .scico-project-news__glyph .is-active { opacity: 1; }
.scico-project-news__item:focus-within .scico-project-news__glyph .is-idle { opacity: 0; }
.scico-project-news__item:focus-within .scico-project-news__rail::before,
.scico-project-news__item:focus-within .scico-project-news__rail::after { top: calc(var(--news-icon) + var(--news-gap)); }
.scico-project-news__item:focus-within .scico-project-news__rail::before { opacity: 1; }
.scico-project-news.is-grayscale .scico-project-news__item:focus-within .scico-project-news__media img { filter: grayscale(0); }
@media (hover: hover) {
	.scico-project-news__item:hover .scico-project-news__glyph { transform: scale(1); }
	.scico-project-news__item:hover .scico-project-news__glyph .is-active { opacity: 1; }
	.scico-project-news__item:hover .scico-project-news__glyph .is-idle { opacity: 0; }
	.scico-project-news__item:hover .scico-project-news__rail::before,
	.scico-project-news__item:hover .scico-project-news__rail::after { top: calc(var(--news-icon) + var(--news-gap)); }
	.scico-project-news__item:hover .scico-project-news__rail::before { opacity: 1; }
	.scico-project-news.is-grayscale .scico-project-news__item:hover .scico-project-news__media img { filter: grayscale(0); }
	.scico-project-news__item:hover .scico-project-news__media img { transform: scale(1.04); }
	.scico-project-news__item.has-link:hover .scico-project-news__date { text-decoration: underline; text-underline-offset: 6px; }
}
@media (prefers-reduced-motion: reduce) {
	.scico-project-news__rail::before,
	.scico-project-news__rail::after,
	.scico-project-news__glyph,
	.scico-project-news__glyph img,
	.scico-project-news__media img { transition: none; }
	.scico-project-news__item:hover .scico-project-news__media img { transform: none; }
}

@media (max-width: 1100px) {
	.scico-project-news { --news-row-gap: 28px; padding: 8px 32px 80px; }
	.scico-project-news h2 { font-size: min(var(--project-news-headingSize, 32px), 28px); }
	.scico-project-news__item { grid-template-columns: 64px 200px minmax(0, 1fr); column-gap: 24px; }
	.scico-project-news__date { font-size: min(var(--project-news-dateSize, 22px), 20px); }
	.scico-project-news__text { font-size: min(var(--project-news-textSize, 18px), 17px); }
}

/* Phones: a narrow rail, a small 4:3 photo and the text beside it. */
@media (max-width: 600px) {
	.scico-project-news { --news-icon: 28px; --news-gap: 8px; --news-row-gap: 24px; padding: 0 16px 64px; }
	.scico-project-news__inner { gap: 24px; }
	.scico-project-news h2 { font-size: min(var(--project-news-headingSize, 32px), 24px); }
	.scico-project-news__item { grid-template-columns: 28px 96px minmax(0, 1fr); column-gap: 12px; }
	.scico-project-news__media { aspect-ratio: 4 / 3; border-radius: 6px; }
	.scico-project-news__body { gap: 4px; }
	.scico-project-news__date { font-size: min(var(--project-news-dateSize, 22px), 16px); }
	.scico-project-news__text { font-size: min(var(--project-news-textSize, 18px), 14px); line-height: 1.7; }
}
