/* Страница «Наши работы» — публикации компании. Строгая монохромная геометрия V22. */

.works-grid [hidden], .work-modal [hidden], .works-empty[hidden] { display: none !important; }

.works-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 28px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.works-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.works-filter { padding: 8px 14px; color: #2e3135; background: #ffffff; border: 1px solid #bfc2c5; border-radius: 0; cursor: pointer; font-size: 12px; font-weight: 500; transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
.works-filter:hover { color: #ffffff; background: #303338; border-color: #303338; }
.works-filter.active { color: #ffffff; background: #303338; border-color: #303338; }
.works-toolbar-spacer { flex: 1; }
.works-count { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 26px 22px; }

.work-card { display: flex; flex-direction: column; padding: 0; color: inherit; text-align: left; background: transparent; border: 0; border-top: 1px solid #bfc2c5; border-radius: 0; box-shadow: none; cursor: pointer; font: inherit; }
.work-card { min-width: 0; overflow-wrap: anywhere; }
.work-card-media { position: relative; width: 100%; flex-shrink: 0; aspect-ratio: 4 / 5; overflow: hidden; background: #f5f5f5; border-bottom: 1px solid var(--line); }
.work-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.work-card:not(.work-card--video):hover .work-card-media img { opacity: .88; }

/* Ролик под курсором: без звука, поверх обложки */
.work-card-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s ease; pointer-events: none; }
.work-card--video.playing .work-card-video { opacity: 1; }
.work-badge { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; color: #ffffff; background: #303338; border-radius: 0; font-size: 10px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.work-card-body { display: flex; flex-direction: column; flex: 1; gap: 9px; padding: 16px 0 0; }
.work-card-meta { display: flex; flex-wrap: wrap; gap: 10px; color: #777b7f; font-size: 10px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; }
.work-card-meta b { color: #303338; font-weight: 600; }
.work-card-body h3 { margin: 0; color: #292c30; font-size: 17px; font-weight: 500; letter-spacing: -.01em; line-height: 1.3; }
.work-card-body p { margin: 0; color: var(--muted); font-size: 13px; }
.work-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.work-card-foot span { color: #303338; font-size: 12px; font-weight: 600; }
.work-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.work-card-tags i { padding: 3px 8px; color: #565b60; background: #f1f2f3; border: 1px solid #e2e3e4; border-radius: 0; font-size: 10px; font-style: normal; letter-spacing: .05em; text-transform: uppercase; }

.works-empty { padding: 64px 20px; text-align: center; background: #f7f7f7; border: 1px solid var(--line); border-radius: 0; }
.works-empty strong { display: block; margin-bottom: 8px; color: #292c30; font-size: 20px; font-weight: 500; }
.works-empty span { color: var(--muted); font-size: 13px; }

.work-modal { position: fixed; inset: 0; z-index: 120; display: none; }
.work-modal.open { display: block; }
.work-modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; background: rgba(26, 28, 30, .58); border: 0; cursor: pointer; }
.work-dialog { position: absolute; left: 50%; top: 4dvh; transform: translateX(-50%); display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); width: min(1080px, calc(100% - 28px)); height: min(820px, 92dvh); overflow: hidden; background: #ffffff; border: 1px solid #8f9397; border-radius: 0; box-shadow: none; }
.work-dialog-media { display: flex; flex-direction: column; min-height: 0; background: #f2f2f2; border-right: 1px solid var(--line); }
.work-dialog-stage { position: relative; flex: 1; min-height: 0; display: flex; background: #1c1e20; }
.work-dialog-stage > img, .work-dialog-stage > video { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #1c1e20; }
.work-dialog-thumbs { display: flex; flex-shrink: 0; gap: 8px; padding: 10px; overflow-x: auto; background: #ffffff; border-top: 1px solid var(--line); }
.work-thumb { position: relative; flex: 0 0 auto; width: 62px; height: 62px; padding: 0; background: none; border: 1px solid #cfd1d3; border-radius: 0; cursor: pointer; opacity: .72; }
.work-thumb img { width: 100%; height: 100%; object-fit: cover; }
.work-thumb i { position: absolute; inset: 0; display: grid; place-items: center; color: #ffffff; background: rgba(24, 28, 32, .42); font-size: 16px; font-style: normal; }
.work-thumb.active, .work-thumb:hover { border-color: #303338; opacity: 1; }
.work-dialog-body { display: flex; flex-direction: column; min-height: 0; overflow: auto; overflow-wrap: anywhere; padding: 48px 32px 32px; overscroll-behavior: contain; }
.work-dialog-close { position: absolute; right: 0; top: 0; z-index: 3; width: 40px; height: 40px; color: #2e3135; background: #ededed; border: 0; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; cursor: pointer; font-size: 20px; line-height: 1; }
.work-dialog-close:hover { color: #ffffff; background: #303338; }
.work-dialog-body .work-card-meta { margin-bottom: 12px; }
.work-dialog-body h2 { margin: 0 0 10px; color: #292c30; font-size: clamp(23px, 2.4vw, 30px); font-weight: 500; letter-spacing: -.03em; line-height: 1.15; }
.work-text { margin: 18px 0 0; color: #3c4045; font-size: 14px; line-height: 1.7; white-space: pre-line; }
.work-dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .work-dialog { display: block; top: 2dvh; height: auto; max-height: 96dvh; overflow-y: auto; overscroll-behavior: contain; }
  .work-dialog-media { border-right: 0; border-bottom: 1px solid var(--line); }
  .work-dialog-stage { flex: 0 0 auto; height: clamp(200px, 46dvh, 480px); }
  .work-dialog-body { overflow: visible; padding: 24px 20px 28px; }
}
@media (max-width: 620px) {
  .works-grid { grid-template-columns: 1fr; gap: 24px; }
  .works-toolbar-spacer { display: none; }
}
