/* «از پروژه‌ها» news timeline — Figma 368:4170. A 3px line on the right with a 16px dot per news, the month beside
   the dot and a bordered card of tag, title, summary and photo. Photos start grey and turn to colour on hover or
   focus (like «اخبار این پروژه»); the title's link covers the whole card. */
.wp-block-post-content > .scico-news-timeline { margin-block-start: 0; }
/* Last on the page (Figma 368:4170): the footer's own top space follows, so the section adds none. */
.wp-block-post-content > .scico-news-timeline:last-child { padding-bottom: 0; }

.scico-news-timeline { --timeline-dot: 16px; --timeline-gap: 32px; --timeline-row-gap: 52px; box-sizing: border-box; margin-block-start: 0; padding: 8px 96px 64px; background: #fff; }
/* Filters — Figma 493:3886: topic chips on the right, the «پروژه» list on the left; chips copy the projects filter. */
.scico-news-timeline__filters { position: relative; z-index: 5; display: flex; width: min(100%, var(--news-timeline-contentWidth, 1248px)); flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 auto 40px; }
.scico-news-timeline__topics { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; list-style: none; }
.scico-news-timeline__chip { display: inline-flex; box-sizing: border-box; height: 48px; align-items: center; justify-content: center; gap: 12px; padding: 0 16px; border: 1.5px solid transparent; border-radius: 4px; background: var(--news-timeline-chipBackground, #f3efe5); color: var(--news-timeline-chipColor, #4c504a); cursor: pointer; font-size: var(--news-timeline-chipSize, 16px); font-weight: 500; line-height: 1.5; text-decoration: none; white-space: nowrap; transition: background-color 200ms ease, border-color 200ms ease; }
/* Figma: the chosen chip has a 1.5px black border. */
.scico-news-timeline__chip[aria-current="true"],
.scico-news-timeline__projects.is-active > .scico-news-timeline__chip,
.scico-news-timeline__projects[open] > .scico-news-timeline__chip { border-color: var(--news-timeline-chipActive, #000); }
.scico-news-timeline__chip:focus-visible,
.scico-news-timeline__panel a:focus-visible,
.scico-news-timeline__empty a:focus-visible { outline: 2px solid #4c504a; outline-offset: 2px; }
.scico-news-timeline__projects { position: relative; }
.scico-news-timeline__projects > summary { list-style: none; }
.scico-news-timeline__projects > summary::-webkit-details-marker { display: none; }
.scico-news-timeline__arrow { display: block; flex: 0 0 auto; transition: transform 200ms ease; }
.scico-news-timeline__projects[open] .scico-news-timeline__arrow { transform: rotate(180deg); }
.scico-news-timeline__panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 20; display: flex; min-width: 220px; max-width: calc(100vw - 32px); max-height: 320px; box-sizing: border-box; flex-direction: column; gap: 2px; margin: 0; padding: 6px; overflow-y: auto; border: 1px solid #eaeaea; border-radius: 8px; background: #fff; box-shadow: 0 14px 30px rgb(19 22 17 / 10%); list-style: none; }
.scico-news-timeline__panel a { display: block; padding: 10px 12px; border-radius: 6px; color: #2a2e28; font-size: 15px; font-weight: 500; line-height: 1.5; text-decoration: none; }
.scico-news-timeline__panel a[aria-current="true"] { background: var(--news-timeline-chipBackground, #f3efe5); font-weight: 700; }
.scico-news-timeline__empty { width: min(100%, var(--news-timeline-contentWidth, 1248px)); margin: 0 auto; color: #4c504a; font-size: 16px; font-weight: 500; line-height: 1.7; text-align: right; }
.scico-news-timeline__empty a { color: inherit; text-decoration: underline; text-underline-offset: 4px; }

.scico-news-timeline__list { position: relative; display: flex; width: min(100%, var(--news-timeline-contentWidth, 1248px)); flex-direction: column; gap: var(--timeline-row-gap); margin: 0 auto; padding: 0 calc(var(--timeline-dot) + var(--timeline-gap)) 0 0; list-style: none; }
/* Figma: one line from the first dot to past the last card, under the dots. */
.scico-news-timeline__list::before { position: absolute; top: calc(var(--timeline-dot) / 2); right: calc(var(--timeline-dot) / 2 - 1.5px); bottom: 0; width: 3px; background: var(--news-timeline-lineColor, #f3efe5); content: ""; }

.scico-news-timeline__item { position: relative; display: flex; flex-direction: column; gap: 24px; margin: 0; padding-inline: 12px; }
.scico-news-timeline__dot { position: absolute; top: 4px; right: calc(-1 * (var(--timeline-dot) + var(--timeline-gap))); width: var(--timeline-dot); height: var(--timeline-dot); border-radius: 50%; background: var(--news-timeline-dotColor, #4c504a); box-shadow: 0 0 0 4px #fff; transition: transform 250ms ease; }
.scico-news-timeline__month { color: var(--news-timeline-monthColor, #000); font-size: var(--news-timeline-monthSize, 18px); font-weight: 600; line-height: 1.4; text-align: right; }

.scico-news-timeline__card { position: relative; display: flex; box-sizing: border-box; align-items: stretch; gap: 32px; padding: 20px; border: 1px solid var(--news-timeline-borderColor, #e9e9e9); border-radius: 8px; background: #fff; transition: border-color 200ms ease, box-shadow 200ms ease; }
.scico-news-timeline__body { display: flex; min-width: 0; flex: 1 1 auto; flex-direction: column; align-items: flex-start; gap: 14px; text-align: right; }
.scico-news-timeline__tag { display: inline-flex; align-items: center; padding: 3px 8px; border: .5px solid var(--news-timeline-tagBorder, #000); border-radius: 4px; background: #fff; color: var(--news-timeline-tagColor, #4c504a); font-size: var(--news-timeline-tagSize, 12px); font-weight: 500; line-height: 1.5; }
.scico-news-timeline__title { margin: 0; color: var(--news-timeline-titleColor, #000); font-size: var(--news-timeline-titleSize, 18px); font-weight: var(--news-timeline-titleWeight, 600); line-height: 1.6; }
.scico-news-timeline__link { color: inherit; text-decoration: none; }
.scico-news-timeline__link::after { position: absolute; z-index: 1; inset: 0; border-radius: 8px; content: ""; }
.scico-news-timeline__link:focus { outline: none; }
.scico-news-timeline__card:has(:focus-visible) { outline: 2px solid #4c504a; outline-offset: 2px; }
/* Figma #696969 SemiBold; 500 at the compact size. */
.scico-news-timeline__summary { margin: 0; color: var(--news-timeline-summaryColor, #696969); font-size: var(--news-timeline-summarySize, 15px); font-weight: 500; line-height: 1.7; }

/* Figma: 140px wide, as tall as the card's text (112px). */
.scico-news-timeline__media { position: relative; overflow: hidden; width: var(--news-timeline-imageWidth, 140px); min-height: 112px; flex: 0 0 auto; order: -1; border-radius: 8px; background: #f3efe5; }
.scico-news-timeline__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-news-timeline.is-grayscale .scico-news-timeline__media img { filter: grayscale(1); }

/* Footer — Figma 752:10651: the dark «more» button (copied from the projects page) over an outlined link. */
[data-news-item][hidden] { display: none; }
/* Card layout («دانش ساختن»): the related-articles cards (news-more.css) in the list's width, without that section's band. */
.scico-news-timeline__cards.scico-news-more { width: min(100%, var(--news-timeline-contentWidth, 1248px)); margin: 0 auto; padding: 0; background: none; }
.scico-news-timeline__footer { display: flex; flex-direction: column; align-items: center; gap: 32px; margin-top: 64px; }
.scico-news-timeline__more { display: inline-flex; height: 48px; box-sizing: border-box; align-items: center; gap: 12px; margin: 0; padding: 0 20px; border: 0; border-radius: 4px; background: var(--news-timeline-buttonBackground, #4c504a); color: var(--news-timeline-buttonColor, #fff); cursor: pointer; font: inherit; font-size: var(--news-timeline-chipSize, 16px); font-weight: 500; line-height: 1.5; transition: background-color 200ms ease; }
.scico-news-timeline__more[hidden] { display: none; }
.scico-news-timeline__more img { display: block; margin-inline: 8px; transition: transform 300ms ease; }
.scico-news-timeline__articles { display: inline-flex; box-sizing: border-box; min-height: 48px; align-items: center; padding: 10px 16px; border: 1px solid var(--news-timeline-chipActive, #000); border-radius: 4px; background: #fff; color: var(--news-timeline-chipColor, #4c504a); font-size: var(--news-timeline-chipSize, 16px); font-weight: 500; line-height: 1.5; text-align: center; text-decoration: none; transition: background-color 200ms ease; }
.scico-news-timeline__more:focus-visible,
.scico-news-timeline__articles:focus-visible { outline: 2px solid #4c504a; outline-offset: 3px; }

/* Active card: hover with a mouse, or keyboard focus on its link. */
.scico-news-timeline__item:focus-within .scico-news-timeline__card { border-color: #c9c9c9; }
.scico-news-timeline.is-grayscale .scico-news-timeline__item:focus-within .scico-news-timeline__media img { filter: grayscale(0); }
@media (hover: hover) {
	.scico-news-timeline__chip:hover { background: color-mix(in srgb, var(--news-timeline-chipBackground, #f3efe5) 92%, #000); }
	.scico-news-timeline__panel a:hover { background: var(--news-timeline-chipBackground, #f3efe5); }
	.scico-news-timeline__more:hover { background: color-mix(in srgb, var(--news-timeline-buttonBackground, #4c504a) 85%, #000); }
	.scico-news-timeline__more:hover img { transform: translateX(-3px); }
	.scico-news-timeline__articles:hover { background: var(--news-timeline-chipBackground, #f3efe5); }
	.scico-news-timeline__item:hover .scico-news-timeline__card { border-color: #c9c9c9; box-shadow: 0 8px 24px rgb(0 0 0 / 6%); }
	.scico-news-timeline__item:hover .scico-news-timeline__dot { transform: scale(1.25); }
	.scico-news-timeline.is-grayscale .scico-news-timeline__item:hover .scico-news-timeline__media img { filter: grayscale(0); }
	.scico-news-timeline__item:hover .scico-news-timeline__media img { transform: scale(1.04); }
	.scico-news-timeline__item:hover .scico-news-timeline__title { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
}
@media (prefers-reduced-motion: reduce) {
	.scico-news-timeline__chip,
	.scico-news-timeline__arrow,
	.scico-news-timeline__more,
	.scico-news-timeline__more img,
	.scico-news-timeline__articles,
	.scico-news-timeline__card,
	.scico-news-timeline__dot,
	.scico-news-timeline__media img { transition: none; }
	.scico-news-timeline__item:hover .scico-news-timeline__media img { transform: none; }
	.scico-news-timeline__more:hover img { transform: none; }
}

@media (max-width: 1100px) {
	.scico-news-timeline { --timeline-gap: 24px; --timeline-row-gap: 40px; padding: 8px 32px 56px; }
}

/* Phones: a narrow rail; the photo sits above the text. */
@media (max-width: 1100px) {
	.scico-news-timeline__cards.scico-news-more { padding: 0; }
}

@media (max-width: 600px) {
	.scico-news-timeline__cards.scico-news-more { padding: 0; }
	.scico-news-timeline { --timeline-dot: 12px; --timeline-gap: 14px; --timeline-row-gap: 32px; padding: 0 16px 48px; }
	.scico-news-timeline__item { gap: 14px; padding-inline: 0; }
	/* The chips scroll sideways in one row; the project list sits above them. */
	/* One line, or the stretched items take the width of the unwrapped chip row. */
	.scico-news-timeline__filters { flex-direction: column-reverse; flex-wrap: nowrap; align-items: stretch; gap: 10px; margin-bottom: 28px; }
	.scico-news-timeline__topics { flex-wrap: nowrap; margin-inline: -16px; padding: 2px 16px; overflow-x: auto; scrollbar-width: none; }
	.scico-news-timeline__topics::-webkit-scrollbar { display: none; }
	.scico-news-timeline__chip { height: 42px; padding: 0 14px; font-size: min(var(--news-timeline-chipSize, 16px), 15px); }
	.scico-news-timeline__projects > .scico-news-timeline__chip { width: 100%; justify-content: space-between; }
	.scico-news-timeline__panel { right: 0; left: 0; max-width: none; }
	.scico-news-timeline__footer { gap: 20px; margin-top: 40px; }
	.scico-news-timeline__more,
	.scico-news-timeline__articles { width: 100%; justify-content: center; font-size: min(var(--news-timeline-chipSize, 16px), 15px); }
	.scico-news-timeline__dot { top: 5px; }
	.scico-news-timeline__month { font-size: min(var(--news-timeline-monthSize, 18px), 16px); }
	.scico-news-timeline__card { flex-direction: column; gap: 14px; padding: 12px; }
	.scico-news-timeline__media { width: 100%; min-height: 0; aspect-ratio: 16 / 9; }
	.scico-news-timeline__body { gap: 10px; padding: 0 4px 4px; }
	.scico-news-timeline__title { font-size: min(var(--news-timeline-titleSize, 18px), 16px); }
	.scico-news-timeline__summary { font-size: min(var(--news-timeline-summarySize, 15px), 14px); }
}
