/* News page photo mosaic — Figma 370:5004. Row «a»: wide photo on the right, two narrow ones; row «b»: the mirror. */
.wp-block-post-content > .scico-news-gallery { margin-block-start: 0; }

.scico-news-gallery { box-sizing: border-box; margin-block-start: 0; padding: 8px 96px 104px; background: #fff; }
.scico-news-gallery__rows { display: flex; width: min(100%, var(--news-gallery-contentWidth, 1248px)); flex-direction: column; gap: var(--news-gallery-gap, 20px); margin-inline: auto; }
.scico-news-gallery__row { display: flex; gap: var(--news-gallery-gap, 20px); }

/* Figma widths 568/320/320 and 300/300/608 as shares of the row; the height follows the page width up to 308px. */
.scico-news-gallery__item { position: relative; display: block; overflow: hidden; box-sizing: border-box; flex: 320 1 0; min-width: 0; height: max(160px, min(var(--news-gallery-rowHeight, 308px), calc(var(--news-gallery-rowVw, 21.389) * 1vw))); margin: 0; padding: 0; border: 0; border-radius: var(--news-gallery-radius, 8px); background: #eceae5; }
.scico-news-gallery__row.is-a .is-wide { flex-grow: 568; }
.scico-news-gallery__row.is-b .is-narrow { flex-grow: 300; }
.scico-news-gallery__row.is-b .is-wide { flex-grow: 608; }
.scico-news-gallery__item.is-full { flex-grow: 1; }
.scico-news-gallery__item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
button.scico-news-gallery__item { cursor: zoom-in; }
button.scico-news-gallery__item:focus-visible { outline: 2px solid #4c504a; outline-offset: 3px; }

/* Lightbox (same look as the project gallery's). */
.scico-news-gallery__lightbox { width: 100vw; max-width: none; height: 100vh; max-height: none; box-sizing: border-box; margin: 0; padding: 56px 72px; border: 0; background: transparent; color: #fff; }
.scico-news-gallery__lightbox::backdrop { background: rgb(17 19 16 / 88%); }
.scico-news-gallery__lightbox[open] { display: flex; align-items: center; justify-content: center; }
.scico-news-gallery__figure { display: flex; max-width: 100%; max-height: 100%; flex-direction: column; align-items: center; gap: 12px; margin: 0; }
.scico-news-gallery__figure img { display: block; max-width: 100%; max-height: calc(100vh - 140px); border-radius: 8px; object-fit: contain; }
.scico-news-gallery__counter { color: rgb(255 255 255 / 80%); font-size: 14px; font-weight: 500; }
.scico-news-gallery__close,
.scico-news-gallery__nav { position: absolute; display: flex; width: 44px; height: 44px; align-items: center; justify-content: center; margin: 0; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / 12%); color: #fff; cursor: pointer; font: inherit; font-size: 22px; line-height: 1; transition: background-color 200ms ease; }
.scico-news-gallery__close { top: 16px; left: 16px; font-size: 26px; }
.scico-news-gallery__nav { top: 50%; transform: translateY(-50%); }
.scico-news-gallery__nav.is-prev { right: 16px; }
.scico-news-gallery__nav.is-next { left: 16px; }
.scico-news-gallery__nav[hidden] { display: none; }
.scico-news-gallery__close:focus-visible,
.scico-news-gallery__nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Editor: empty state. */
.scico-news-gallery__empty { width: min(100%, var(--news-gallery-contentWidth, 1248px)); box-sizing: border-box; margin: 0 auto; padding: 32px; border: 1px dashed #c8c8c8; border-radius: 8px; background: #fafafa; color: #4c504a; text-align: center; }

@media (hover: hover) {
	button.scico-news-gallery__item:hover img { transform: scale(1.04); }
	.scico-news-gallery__close:hover,
	.scico-news-gallery__nav:hover { background: rgb(255 255 255 / 22%); }
}

@media (prefers-reduced-motion: reduce) {
	.scico-news-gallery__item img,
	.scico-news-gallery__close,
	.scico-news-gallery__nav { transition: none; }
	button.scico-news-gallery__item:hover img { transform: none; }
}

@media (max-width: 1100px) {
	.scico-news-gallery { padding: 0 32px 88px; }
	.scico-news-gallery__rows,
	.scico-news-gallery__row { gap: min(var(--news-gallery-gap, 20px), 16px); }
}

/* Two columns: the wide photo of each row spans both, so the rhythm is wide / two narrow / two narrow / wide. */
@media (max-width: 760px) {
	.scico-news-gallery__rows { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
	.scico-news-gallery__row { display: contents; }
	.scico-news-gallery__item { height: 180px; }
	.scico-news-gallery__item.is-wide,
	.scico-news-gallery__item.is-full,
	/* A short last row (wide + one narrow) would leave the narrow photo half a line: it spans too. */
	.scico-news-gallery__row > .is-narrow:first-child:nth-last-child(2),
	.scico-news-gallery__row > .is-narrow:last-child:nth-child(2) { grid-column: span 2; height: 220px; }
	.scico-news-gallery__lightbox { padding: 56px 12px 72px; }
	.scico-news-gallery__nav { top: auto; bottom: 16px; transform: none; }
	.scico-news-gallery__nav.is-prev { right: calc(50% - 56px); }
	.scico-news-gallery__nav.is-next { left: calc(50% - 56px); }
}

@media (max-width: 600px) {
	.scico-news-gallery { padding: 0 16px 64px; }
	.scico-news-gallery__rows { gap: 8px; }
	.scico-news-gallery__item { height: 150px; }
	.scico-news-gallery__item.is-wide,
	.scico-news-gallery__item.is-full,
	.scico-news-gallery__row > .is-narrow:first-child:nth-last-child(2),
	.scico-news-gallery__row > .is-narrow:last-child:nth-child(2) { height: 200px; }
}

/* Layout «cards» — about page «افتخارات و گواهی‌ها», Figma 688:2005: a centred heading (32 Black → 32/800) 40px over
   equal 300×400 cards, 40 apart, in a centred row. Cards lift on hover. */
.scico-news-gallery--cards { padding: 88px 96px 104px; }
.scico-news-gallery--cards h2 { margin: 0 0 40px; color: var(--news-gallery-titleColor, #000); font-size: var(--news-gallery-titleSize, 32px); font-weight: var(--news-gallery-titleWeight, 800); line-height: 1.4; text-align: center; }
.scico-news-gallery__cards { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--news-gallery-gap, 40px); }
.scico-news-gallery__item.is-card { width: var(--news-gallery-cardWidth, 300px); height: auto; flex: 0 1 var(--news-gallery-cardWidth, 300px); aspect-ratio: var(--news-gallery-cardRatio, .75); background: #f4f4f2; transition: transform 300ms ease, box-shadow 300ms ease; }
@media (hover: hover) {
	button.scico-news-gallery__item.is-card:hover { box-shadow: 0 16px 32px rgb(0 0 0 / 12%); transform: translateY(-4px); }
	button.scico-news-gallery__item.is-card:hover img { transform: scale(1.03); }
}
@media (prefers-reduced-motion: reduce) {
	.scico-news-gallery__item.is-card { transition: none; }
	button.scico-news-gallery__item.is-card:hover { transform: none; }
}
@media (max-width: 1100px) {
	.scico-news-gallery--cards { padding: 72px 32px 88px; }
	.scico-news-gallery__cards { gap: min(var(--news-gallery-gap, 40px), 24px); }
}
@media (max-width: 760px) {
	.scico-news-gallery--cards h2 { margin-bottom: 28px; font-size: min(var(--news-gallery-titleSize, 32px), 24px); }
	.scico-news-gallery__item.is-card { flex-basis: calc(50% - 12px); }
}
@media (max-width: 480px) {
	.scico-news-gallery--cards { padding: 56px 16px 64px; }
	.scico-news-gallery__cards { gap: 12px; }
	.scico-news-gallery__item.is-card { flex-basis: calc(50% - 6px); }
}

/* Phones: the lightbox is a dark bottom sheet (shape, handle and motion from dialog.scico-sheet in style.css). */
@media (max-width: 767px) {
	.scico-news-gallery__lightbox { padding: 60px 12px calc(76px + env(safe-area-inset-bottom)); background: #1b1f19; }
	.scico-news-gallery__lightbox::backdrop { background: rgb(17 19 16 / 72%); }
	.scico-news-gallery__figure { width: 100%; }
	.scico-news-gallery__figure img { max-height: calc(100dvh - 240px); }
	.scico-news-gallery__close { top: 12px; left: 12px; }
	.scico-news-gallery__nav { top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); transform: none; }
	.scico-news-gallery__nav.is-prev { right: calc(50% - 56px); }
	.scico-news-gallery__nav.is-next { left: calc(50% - 56px); }
}
