/* Munkakártyák és galéria. A refinement.css UTÁN töltendő be. */
#munkaink .works-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 24px;
  align-items: stretch;
}
#munkaink .work-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 600px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffefa;
  box-shadow: 0 4px 18px #24272206;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  appearance: none;
  -webkit-appearance: none;
  color: #242722;
}
#munkaink .work-card:hover {
  transform: translateY(-4px);
  border-color: #c8b498;
  box-shadow: 0 14px 32px #24272212;
}
#munkaink .work-photo {
  position: relative;
  width: 100%;
  height: clamp(185px, 18vw, 260px);
  aspect-ratio: auto;
  flex-shrink: 0;
}
#munkaink .work-photo img { width: 100%; height: 100%; object-fit: cover; }
.work-photo-count {
  position: absolute;
  right: 13px;
  bottom: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  background: #fffefaf2;
  color: #242722;
  font-size: 12px;
  font-weight: 600;
}
.work-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.work-photo-count .work-icon { width: 16px; height: 16px; }
.work-card-body { display: flex; flex-direction: column; flex: 1; width: 100%; padding: 22px; }
#munkaink .work-card .eyebrow { margin: 0 0 10px; font-size: 10px; line-height: 1.5; }
#munkaink .work-card h3 { margin: 0 0 12px; font-size: 29px; line-height: 1.08; }
.work-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 14px; line-height: 1.55; color: #686e60; margin: 0 0 20px; }
.work-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 16px; border-top: 1px solid #e9e5dd; font-size: 13px; font-weight: 600; }
.work-card-arrow { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; background: #f2ede3; color: #242722; transition: background .2s; }
.work-card:hover .work-card-arrow { background: #ed842f; }
#filters button { min-height: 42px; border-radius: 6px; color: #242722; appearance: none; -webkit-appearance: none; }
#filters button.active { color: #fff; }

/* A natív dialog biztosítja a fókuszcsapdát és az Escape bezárást. */
#workDialog.work-modal {
  width: min(1020px, calc(100% - 40px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  border: 1px solid #dedbd1;
  border-radius: 15px;
  background: #fffefa;
  color: #242722;
  box-shadow: 0 30px 100px #0005;
  overflow: auto;
  overscroll-behavior: contain;
}
#workDialog::backdrop { background: #151b16b8; backdrop-filter: blur(5px); }
.work-modal-topbar { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 12px 20px; border-bottom: 1px solid #e9e5dd; background: #fffefa; }
.work-modal-topbar .eyebrow { margin: 0; color: #69715e; font-size: 10px; }
#workDialog .work-close {
  display: grid; place-items: center; flex-shrink: 0;
  width: 44px; height: 44px; padding: 10px;
  border: 1px solid #e2e0d7; border-radius: 50%;
  background: #f5f3ed; color: #000;
  appearance: none; -webkit-appearance: none;
  -webkit-text-fill-color: #000;
}
#workDialog .work-close:hover { background: #eae6dc; }
#workDialog .work-close svg { color: #000; stroke: #000; }
.work-modal-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.work-gallery { min-width: 0; padding: 22px; background: #f3f1eb; }
.work-stage { position: relative; height: clamp(220px, 48dvh, 440px); background: #e8e5dc; border-radius: 9px; overflow: hidden; touch-action: pan-y pinch-zoom; }
.work-image-holder { position: absolute; inset: 0; display: grid; place-items: center; }
#workDialog .work-main-image { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.work-image-state { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px 55px; margin: 0; text-align: center; color: #62685b; font-size: 14px; }
#workDialog .work-gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 44px; padding: 10px; border: 1px solid #ffffffc9; border-radius: 50%; background: #fffefaf5; color: #000; box-shadow: 0 3px 12px #0002; appearance: none; -webkit-appearance: none; }
.work-gallery-arrow.previous { left: 10px; }
.work-gallery-arrow.next { right: 10px; }
#workDialog .work-gallery-arrow:hover { background: #fff; }
.work-gallery-caption { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: #6a7061; margin: 12px 0; }
.work-counter { font-variant-numeric: tabular-nums; }
.work-thumbnails { position: relative; display: flex; gap: 9px; overflow-x: auto; padding: 3px 2px 8px; scrollbar-width: thin; }
.work-thumbnail { flex: 0 0 64px; width: 64px; height: 58px; padding: 3px; border: 2px solid transparent; border-radius: 7px; background: #e5e1d7; appearance: none; -webkit-appearance: none; }
.work-thumbnail img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.work-thumbnail.active { border-color: #ba570f; background: #fff; }
.work-info { display: flex; flex-direction: column; min-width: 0; padding: 30px 26px; }
.work-category { width: fit-content; padding: 5px 9px; border-radius: 4px; background: #eaf0e1; color: #52633e; font-size: 11px; font-weight: 600; margin: 0 0 20px; }
#workDialog #dialogTitle { font-size: clamp(30px, 3.2vw, 40px); margin: 0 0 18px; line-height: 1.05; overflow-wrap: anywhere; }
.work-description { color: #646b5b; font-size: 15px; line-height: 1.75; margin: 0 0 26px; }
.work-contact { margin-top: auto; font-size: 13px; }
#workDialog [hidden] { display: none !important; }
@media(min-width:1800px) { #munkaink .works-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media(max-width:760px) {
  #munkaink .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  #munkaink .work-photo { height: 190px; }
  .work-card-body { padding: 18px; }
  #munkaink .work-card h3 { font-size: 26px; }
  #workDialog.work-modal { width: calc(100% - 20px); max-height: calc(100dvh - 20px); border-radius: 12px; }
  .work-modal-topbar { padding: 8px 14px; }
  .work-modal-layout { grid-template-columns: 1fr; }
  .work-gallery { padding: 14px; }
  .work-stage { height: clamp(170px, 38dvh, 320px); }
  .work-thumbnail { flex-basis: 58px; width: 58px; height: 52px; }
  .work-info { padding: 22px 20px; }
  .work-category { margin-bottom: 12px; }
  #workDialog #dialogTitle { font-size: 32px; }
  .work-description { font-size: 14px; margin-bottom: 20px; }
  .work-contact { min-height: 46px; }
}
@media(max-width:480px) { #munkaink .works-grid { grid-template-columns: 1fr; } #munkaink .work-photo { height: 220px; } }
@media(prefers-reduced-motion:reduce) { #munkaink .work-card, .work-card-arrow { transition: none; } }
