/* Works-only catalog owner: categories, collection flow, case copy/actions and
   the compact selector. Before/after media internals remain in before-after.css. */

body[data-route="works"] .works-layout {
  display: grid;
  grid-template-columns: minmax(240px, 315px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 60px;
}

body[data-route="works"] .works-categories {
  width: 100%;
  padding: 5px;
  background: #fff;
}

body[data-route="works"] .works-category-current {
  display: none;
}

body[data-route="works"] .works-category-list {
  display: grid;
  gap: 5px;
}

body[data-route="works"] .works-category {
  min-height: 41px;
  padding: 12px 15px 13px;
  color: #5f5f5f;
  background: #f5f5f5;
  border: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.02em;
  text-align: left;
}

body[data-route="works"] .works-category.is-current {
  color: #fff;
  background: #010f77;
}

body[data-route="works"] .works-category:focus-visible,
body[data-route="works"] .works-category-current:focus-visible {
  outline: 2px solid #4961ff;
  outline-offset: 3px;
}

body[data-route="works"] .works-cases-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
  padding-top: 5px;
}

body[data-route="works"] .works-case[hidden],
body[data-route="works"] .works-empty-message[hidden] {
  display: none;
}

body[data-route="works"] .works-case {
  min-width: 0;
}

body[data-route="works"] .works-case h2 {
  width: max-content;
  max-width: 100%;
  margin: 20px 0 0;
  color: #303030;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.02em;
}

body[data-route="works"] .works-case > p {
  width: max-content;
  max-width: 100%;
  margin: 20px 0 0;
  color: #303030;
  font-size: 14px;
  line-height: 1;
}

body[data-route="works"] .works-case__cta {
  --corner-color: #010f77;
  --corner-inset: -1px;
  position: relative;
  display: grid;
  width: 100%;
  min-height: 50px;
  place-items: center;
  margin-top: 30px;
  padding: 0;
  color: #303030;
  background: transparent;
  border: 1px solid #c4c4c1;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}

body[data-route="works"] .works-case__cta::before,
body[data-route="works"] .works-case__cta::after {
  position: absolute;
  width: 10px;
  height: 10px;
  background: transparent;
  content: "";
  transform-origin: center;
  pointer-events: none;
}

body[data-route="works"] .works-case__cta::before {
  top: calc(100% - var(--corner-inset) - 10px);
  left: var(--corner-inset);
  border-bottom: 2px solid var(--corner-color);
  border-left: 2px solid var(--corner-color);
}

body[data-route="works"] .works-case__cta::after {
  top: var(--corner-inset);
  left: calc(100% - var(--corner-inset) - 10px);
  border-top: 2px solid var(--corner-color);
  border-right: 2px solid var(--corner-color);
}

@media (hover: hover) {
  body[data-route="works"] .works-case__cta:hover {
    --corner-color: #fff;
    color: #fff;
    background: #010f77;
    border-color: #010f77;
  }

  body[data-route="works"] .works-case__cta:hover::before {
    animation: home-corner-before-clockwise .58s cubic-bezier(.45, 0, .2, 1) both;
  }

  body[data-route="works"] .works-case__cta:hover::after {
    animation: home-corner-after-clockwise .58s cubic-bezier(.45, 0, .2, 1) both;
  }
}

body[data-route="works"] .works-case__cta:focus-visible {
  --corner-color: #fff;
  color: #fff;
  background: #010f77;
  border-color: #010f77;
}

body[data-route="works"] .works-case__cta:focus-visible::before {
  animation: home-corner-before-clockwise .58s cubic-bezier(.45, 0, .2, 1) both;
}

body[data-route="works"] .works-case__cta:focus-visible::after {
  animation: home-corner-after-clockwise .58s cubic-bezier(.45, 0, .2, 1) both;
}

body[data-route="works"] .works-empty-message {
  grid-column: 1 / -1;
  margin: 0;
  padding: 30px;
  color: #5f5f5f;
  background: #fff;
  font-size: 16px;
}

body[data-route="works"] .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 1440px) {
  body[data-route="works"] .works-cases-grid {
    grid-template-columns: repeat(3, 316px);
  }
}

@media (min-width: 1000px) and (max-width: 1359px) {
  body[data-route="works"] .works-layout {
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  }

  body[data-route="works"] .works-cases-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) and (max-width: 999px) {
  body[data-route="works"] .works-layout {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 45px;
  }

  body[data-route="works"] .works-categories {
    padding: 0;
    background: transparent;
  }

  body[data-route="works"] .works-category-current {
    position: relative;
    display: flex;
    min-height: 49px;
    align-items: center;
    padding: 0 50px 0 15px;
    color: #fff;
    background: #010f77;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -.02em;
    list-style: none;
    cursor: pointer;
  }

  body[data-route="works"] .works-category-current { border: 2px outset buttonborder; }
  body[data-route="works"] .works-category-disclosure { position: absolute; width: 1px; height: 1px; opacity: 0; }
  body[data-route="works"] .works-category-current:has(.works-category-disclosure:focus-visible) { outline: 2px solid #010f77; outline-offset: 2px; }

  body[data-route="works"] .works-category-current::after {
    position: absolute;
    top: 15px;
    right: 21px;
    width: 13px;
    height: 13px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    content: "";
    transform: rotate(45deg);
    transform-origin: center;
  }

  body[data-route="works"] .works-categories:is(.is-open, :has(.works-category-disclosure:checked)) .works-category-current::after {
    top: 22px;
    transform: rotate(225deg);
  }

  body[data-route="works"] .works-categories:not(.is-open):not(:has(.works-category-disclosure:checked)) > .works-category-list {
    display: none;
  }

  body[data-route="works"] .works-category-list {
    padding: 5px;
    background: #fff;
  }

  body[data-route="works"] .works-cases-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 0;
  }
}

@media (max-width: 767px) {
  body[data-route="works"] .works-layout {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 30px;
    row-gap: 30px;
  }

  body[data-route="works"] .works-categories {
    padding: 0;
    background: transparent;
  }

  body[data-route="works"] .works-category-current {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 49px;
    align-items: center;
    padding: 0 50px 0 15px;
    color: #fff;
    background: #010f77;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -.02em;
    list-style: none;
    cursor: pointer;
  }

  body[data-route="works"] .works-category-current { border: 2px outset buttonborder; }
  body[data-route="works"] .works-category-disclosure { position: absolute; width: 1px; height: 1px; opacity: 0; }
  body[data-route="works"] .works-category-current:has(.works-category-disclosure:focus-visible) { outline: 2px solid #010f77; outline-offset: 2px; }

  body[data-route="works"] .works-category-current::after {
    position: absolute;
    top: 15px;
    right: 21px;
    width: 13px;
    height: 13px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    content: "";
    transform: rotate(45deg);
    transform-origin: center;
  }

  body[data-route="works"] .works-categories:is(.is-open, :has(.works-category-disclosure:checked)) .works-category-current::after {
    top: 22px;
    transform: rotate(225deg);
  }

  body[data-route="works"] .works-categories:not(.is-open):not(:has(.works-category-disclosure:checked)) > .works-category-list {
    display: none;
  }

  body[data-route="works"] .works-category-list {
    padding: 5px;
    background: #fff;
  }

  body[data-route="works"] .works-cases-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding-top: 0;
  }

  body[data-route="works"] .works-case > p {
    margin-top: 10px;
  }

  body[data-route="works"] .works-case__cta {
    margin-top: 25px;
  }
}

@media (max-width: 410px) {
  body[data-route="works"] .works-category-current,
  body[data-route="works"] .works-category {
    font-size: 15px;
  }
}
