/* =========================
   Works / Portfolio
========================= */

.works-page {
  background: #fff;
  color: #162033;
}

.works-page .section-title {
  margin-bottom: 42px;
}

.works-page .section-title h3 {
  color: #0b2545;
  letter-spacing: -0.03em;
}

.case-study-section {
  margin: -8px 0 46px;
  padding: 34px;
  border: 1px solid #dfe6ee;
  border-radius: 6px;
  background: #f8f9fa;
}

.case-study-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.case-study-heading p,
.case-study-heading h4,
.case-study-heading span {
  margin: 0;
}

.case-study-heading p {
  color: #0077b6;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.case-study-heading h4 {
  flex: 1;
  color: #0b2545;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.case-study-heading span {
  color: #667085;
  font-size: 14px;
  font-weight: 700;
}

.case-study-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.case-study-card {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(0, 1.1fr);
  min-height: 220px;
  overflow: hidden;
  border: 1px solid #d8e2ec;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.case-study-card:hover {
  transform: translateY(-4px);
  border-color: #9cc9e2;
  box-shadow: 0 18px 40px rgba(11, 37, 69, 0.1);
}

.case-study-img {
  min-height: 100%;
  background: #e9eff5 center / cover no-repeat;
}

.case-study-body {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.case-study-body p {
  margin: 0 0 10px;
  color: #0077b6;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.case-study-body h5 {
  margin: 0;
  color: #0b2545;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 900;
  letter-spacing: -0.03em;
  word-break: keep-all;
}

.case-study-body span {
  margin-top: 12px;
  color: #475467;
  font-size: 14px;
  line-height: 1.65;
  font-weight: 700;
  word-break: keep-all;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.case-study-body button {
  align-self: flex-start;
  height: 36px;
  margin-top: auto;
  padding: 0 14px;
  border: 1px solid #0b2545;
  border-radius: 4px;
  background: #0b2545;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.works-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 18px 0;
  border-top: 1px solid #dfe6ee;
  border-bottom: 1px solid #dfe6ee;
}

.works-page .blind {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tabs button {
  height: 42px;
  padding: 0 18px;
  border: 1px solid #dfe6ee;
  border-radius: 4px;
  background: #fff;
  color: #344054;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.filter-tabs button:hover,
.filter-tabs button.active {
  border-color: #0b2545;
  background: #0b2545;
  color: #fff;
}

.works-search {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-width: 360px;
}

.works-search select,
.works-search input {
  height: 42px;
  border: 1px solid #dfe6ee;
  border-radius: 4px;
  background: #fff;
  color: #344054;
  font-size: 14px;
  font-weight: 800;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.works-search select {
  width: 110px;
  padding: 0 32px 0 12px;
}

.works-search input {
  width: min(260px, 100%);
  padding: 0 14px;
}

.works-search select:focus,
.works-search input:focus {
  border-color: #0077b6;
  box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.12);
}

.works-search button {
  height: 42px;
  padding: 0 16px;
  border: 1px solid #0b2545;
  border-radius: 4px;
  background: #0b2545;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.works-search button:hover {
  border-color: #0077b6;
  background: #0077b6;
}

.works-search .btn-reset {
  border-color: #dfe6ee;
  background: #fff;
  color: #475467;
}

.works-search .btn-reset:hover {
  border-color: #0b2545;
  background: #fff;
  color: #0b2545;
}

.works-count {
  margin: 0;
  color: #667085;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.result-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.result-list.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.result-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 462px;
  border: 1px solid #dfe6ee;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.result-card:hover {
  transform: translateY(-5px);
  border-color: #b8d9ec;
  box-shadow: 0 18px 44px rgba(11, 37, 69, 0.12);
}

.result-img {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  background: #eef3f7 center / cover no-repeat;
  overflow: hidden;
}

.result-img::before {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
  background-size: cover;
  background-position: center;
  transition: transform 0.8s ease;
}

.result-card:hover .result-img::before {
  transform: scale(1.055);
}

.result-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 37, 69, 0.52);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.result-card:hover .result-overlay {
  opacity: 1;
}

.result-overlay span {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.result-body {
  display: grid;
  grid-template-rows: 64px 56px 1fr;
  padding: 20px;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
  min-height: 54px;
  margin-bottom: 14px;
  overflow: hidden;
}

.result-meta span {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid #dfe6ee;
  border-radius: 4px;
  background: #f8f9fa;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
}

.result-title {
  margin: 0;
  height: 52px;
  color: #0b2545;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.45;
  letter-spacing: -0.03em;
  word-break: keep-all;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.result-card:hover .result-title {
  color: #0077b6;
}

.result-detail {
  align-self: end;
  display: grid;
  gap: 8px;
  min-height: 80px;
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid #e5eaf0;
}

.result-detail p {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 8px;
  min-height: 22px;
  margin: 0;
  color: #667085;
  font-size: 14px;
  line-height: 1.55;
  word-break: keep-all;
}

.result-detail b {
  color: #0b2545;
  font-weight: 900;
}

.result-detail p:not(:first-child) {
  white-space: nowrap;
}

.result-empty {
  grid-column: 1 / -1;
  padding: 72px 24px;
  border: 1px solid #dfe6ee;
  border-radius: 6px;
  background: #f8f9fa;
  text-align: center;
  color: #667085;
  font-size: 16px;
  font-weight: 700;
}

.skeleton {
  pointer-events: none;
}

.skeleton .result-img,
.skeleton .result-meta span,
.skeleton .result-title,
.skeleton .result-detail p {
  background: linear-gradient(90deg, #eef3f7 25%, #f8f9fa 37%, #eef3f7 63%);
  background-size: 400% 100%;
  color: transparent;
  animation: skeletonShine 1.15s ease infinite;
}

.skeleton .result-title {
  height: 48px;
}

.skeleton .result-detail p {
  height: 18px;
}

@keyframes skeletonShine {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.result-paging {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 56px;
}

.result-paging button {
  min-width: 38px;
  height: 38px;
  border: 1px solid #dfe6ee;
  border-radius: 4px;
  background: #fff;
  color: #475467;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.25s;
}

.result-paging button:hover {
  border-color: #0077b6;
  color: #0077b6;
}

.result-paging button.active {
  border-color: #0b2545;
  background: #0b2545;
  color: #fff;
}

.result-paging button:disabled {
  color: #b8c2cc;
  cursor: default;
}

.paging-dot {
  color: #98a2b3;
  font-weight: 900;
}

body.modal-open {
  overflow: hidden;
}

.work-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.work-modal.active {
  display: flex;
}

.work-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}

.work-modal-panel {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(11, 37, 69, 0.28);
}

.work-modal-close {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 4px;
  background: rgba(11, 37, 69, 0.84);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.work-modal-image {
  min-height: 520px;
  background: #eef3f7 center / cover no-repeat;
}

.work-modal-body {
  padding: 48px 44px;
  overflow-y: auto;
}

.work-modal-eyebrow {
  margin: 0 0 12px;
  color: #0077b6;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.work-modal-body h3 {
  margin: 0;
  color: #0b2545;
  font-size: 32px;
  line-height: 1.35;
  font-weight: 900;
  letter-spacing: -0.04em;
  word-break: keep-all;
}

.work-modal-info {
  display: grid;
  gap: 0;
  margin: 30px 0 0;
  border-top: 1px solid #dfe6ee;
}

.work-modal-info div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid #e5eaf0;
}

.work-modal-info dt,
.work-modal-info dd {
  margin: 0;
  line-height: 1.6;
}

.work-modal-info dt {
  color: #0b2545;
  font-size: 14px;
  font-weight: 900;
}

.work-modal-info dd {
  color: #344054;
  font-size: 15px;
  font-weight: 700;
  word-break: keep-all;
}

.work-case-block {
  grid-template-columns: 112px minmax(0, 1fr) !important;
  align-items: start;
}

.work-case-block > dd {
  display: grid;
  gap: 14px;
}

.work-case-row {
  display: grid !important;
  grid-template-columns: 92px minmax(0, 1fr) !important;
  gap: 14px !important;
  padding: 0 !important;
  border-bottom: 0 !important;
}

.work-case-row dt {
  color: #0077b6;
}

@media (max-width: 1180px) {
  .result-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .case-study-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .case-study-section {
    padding: 24px;
  }

  .case-study-heading {
    display: grid;
  }

  .works-summary {
    grid-template-columns: 1fr;
  }

  .works-summary div {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }

  .works-summary div:last-child {
    border-bottom: 0;
  }

  .works-toolbar {
    display: grid;
  }

  .works-search {
    justify-content: stretch;
    min-width: 0;
  }

  .works-search input {
    width: 100%;
  }

  .works-count {
    white-space: normal;
  }

  .result-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-modal-panel {
    grid-template-columns: 1fr;
  }

  .work-modal-image {
    min-height: 320px;
  }
}

@media (max-width: 560px) {
  .case-study-card {
    grid-template-columns: 1fr;
  }

  .case-study-img {
    min-height: 190px;
  }

  .filter-tabs button {
    flex: 1 1 calc(50% - 8px);
    padding: 0 10px;
  }

  .works-search {
    display: grid;
    grid-template-columns: 104px 1fr;
  }

  .works-search button {
    width: 100%;
  }

  .result-list {
    grid-template-columns: 1fr;
  }

  .result-card {
    min-height: 0;
  }

  .work-modal {
    padding: 16px;
  }

  .work-modal-body {
    padding: 32px 24px;
  }

  .work-modal-body h3 {
    font-size: 25px;
  }

  .work-modal-info div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Typography refinement overrides */
.works-page {
  font-family: var(--font-primary);
  letter-spacing: var(--letter-body);
}

.works-page p,
.works-page span,
.works-page li {
  font-weight: var(--font-body-weight);
  letter-spacing: var(--letter-body);
}

.works-page h3,
.works-page h4,
.works-page h5 {
  font-weight: var(--font-heading-weight);
  letter-spacing: var(--letter-heading);
}

.case-study-heading p,
.filter-tabs button,
.works-count,
.result-meta span,
.result-detail b,
.result-overlay span,
.work-modal-body p,
.work-modal-info b,
.work-modal-close {
  font-weight: var(--font-emphasis-weight);
}
