/* Project page «گالری تصاویر» — Figma 687:1378. Tabs under the heading; three columns of tall (406×569) and short
   (406×276) photos that alternate, so every two rows line up. A photo opens in a lightbox dialog. */
.wp-block-post-content > .scico-project-gallery { margin-block-start: 0; }

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

.scico-project-gallery__tabs { display: flex; flex-wrap: wrap; gap: 12px; }
.scico-project-gallery__tab { display: inline-flex; height: 44px; box-sizing: border-box; align-items: center; margin: 0; padding: 0 14px; border: 1px solid transparent; border-radius: 4px; background: var(--project-gallery-tabBackground, #f3efe5); color: var(--project-gallery-tabColor, #767676); cursor: pointer; font: inherit; font-size: var(--project-gallery-tabSize, 16px); font-weight: var(--project-gallery-tabWeight, 500); line-height: 1.5; white-space: nowrap; transition: color 200ms ease, border-color 200ms ease, background-color 200ms ease; }
.scico-project-gallery__tab[aria-selected="true"] { border-color: var(--project-gallery-tabActiveColor, #4c504a); color: var(--project-gallery-tabActiveColor, #4c504a); }
.scico-project-gallery__tab:focus-visible { outline: 2px solid var(--project-gallery-tabActiveColor, #4c504a); outline-offset: 2px; }

.scico-project-gallery__panel[hidden] { display: none; }
.scico-project-gallery__panel { animation: scico-gallery-in 350ms ease-out; }
@keyframes scico-gallery-in { from { opacity: 0; } to { opacity: 1; } }
.scico-project-gallery__grid { display: flex; align-items: flex-start; gap: 16px; }
.scico-project-gallery__column { display: flex; min-width: 0; flex: 1 1 0; flex-direction: column; gap: 16px; }
.scico-project-gallery__item { position: relative; display: block; width: 100%; margin: 0; padding: 0; overflow: hidden; border: 0; background: #f3efe5; cursor: zoom-in; }
figure.scico-project-gallery__item { cursor: default; }
.scico-project-gallery__item.is-tall { aspect-ratio: 406 / 569; }
.scico-project-gallery__item.is-short { aspect-ratio: 406 / 276; }
.scico-project-gallery__item img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; transition: transform 700ms cubic-bezier(.2, .7, .2, 1); }
.scico-project-gallery__item:focus-visible { outline: 2px solid #4c504a; outline-offset: 3px; }

/* Lightbox: native modal dialog, photo fitted to the window, arrows on either side. */
.scico-project-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-project-gallery__lightbox::backdrop { background: rgb(17 19 16 / 88%); }
.scico-project-gallery__lightbox[open] { display: flex; align-items: center; justify-content: center; }
.scico-project-gallery__figure { display: flex; max-width: 100%; max-height: 100%; flex-direction: column; align-items: center; gap: 12px; margin: 0; }
.scico-project-gallery__figure img { display: block; max-width: 100%; max-height: calc(100vh - 150px); border-radius: 6px; object-fit: contain; }
.scico-project-gallery__counter { color: rgb(255 255 255 / 80%); font-size: 14px; font-weight: 500; }
.scico-project-gallery__close,
.scico-project-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-project-gallery__close { top: 16px; left: 16px; font-size: 26px; }
.scico-project-gallery__nav { top: 50%; transform: translateY(-50%); }
.scico-project-gallery__nav.is-prev { right: 16px; }
.scico-project-gallery__nav.is-next { left: 16px; }
.scico-project-gallery__nav[hidden] { display: none; }
.scico-project-gallery__close:focus-visible,
.scico-project-gallery__nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (hover: hover) {
	.scico-project-gallery__tab[aria-selected="false"]:hover { color: var(--project-gallery-tabActiveColor, #4c504a); }
	.scico-project-gallery__item:hover img { transform: scale(1.04); }
	.scico-project-gallery__close:hover,
	.scico-project-gallery__nav:hover { background: rgb(255 255 255 / 22%); }
}
@media (prefers-reduced-motion: reduce) {
	.scico-project-gallery__panel { animation: none; }
	.scico-project-gallery__item img { transition: none; }
	.scico-project-gallery__item:hover img { transform: none; }
}

@media (max-width: 1100px) {
	.scico-project-gallery { padding: 8px 32px 80px; }
	.scico-project-gallery h2 { font-size: min(var(--project-gallery-headingSize, 32px), 28px); }
	.scico-project-gallery__grid,
	.scico-project-gallery__column { gap: 12px; }
}

/* Phones: the tall/short rhythm gets too thin, so the columns dissolve into a two-column grid in photo order —
   one full-width 16:10 photo, then a pair of squares. */
@media (max-width: 600px) {
	.scico-project-gallery { padding: 0 16px 64px; }
	.scico-project-gallery__inner { gap: 20px; }
	.scico-project-gallery__head { gap: 16px; }
	.scico-project-gallery h2 { font-size: min(var(--project-gallery-headingSize, 32px), 24px); }
	.scico-project-gallery__tabs { gap: 8px; }
	.scico-project-gallery__tab { height: 38px; padding: 0 12px; font-size: min(var(--project-gallery-tabSize, 16px), 14px); }
	.scico-project-gallery__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
	.scico-project-gallery__column { display: contents; }
	.scico-project-gallery__item { order: var(--project-gallery-order, 0); }
	.scico-project-gallery__item.is-tall,
	.scico-project-gallery__item.is-short { aspect-ratio: 1; }
	.scico-project-gallery__item.is-wide { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
	.scico-project-gallery__lightbox { padding: 56px 12px 72px; }
	.scico-project-gallery__nav { top: auto; bottom: 16px; transform: none; }
	.scico-project-gallery__nav.is-prev { right: calc(50% - 56px); }
	.scico-project-gallery__nav.is-next { left: calc(50% - 56px); }
}

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