@import url("./company.css");

/* Public 인증서 gallery — Figma 133:761 */

.company-cert {
  padding: clamp(72px, 7.29vw, 140px) 0 clamp(88px, 8.85vw, 170px);
  background-color: #fff;
}

.company-cert__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  width: min(100%, 1390px);
  margin-inline: auto;
}

.company-cert__title {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: clamp(28px, 2.08vw, 40px);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: -0.02em;
  color: #191919;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.company-cert__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  /* Figma 133:761 — 1390 row, 4×300 thumbs → 30px gutters */
  column-gap: 30px;
  row-gap: 40px;
  width: 100%;
}

.company-cert-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 25px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: center;
  transition: transform 0.25s ease;
}

.company-cert-card:hover,
.company-cert-card:focus-visible {
  transform: translateY(-4px);
}

.company-cert-card:focus-visible {
  outline: 2px solid #f99c1b;
  outline-offset: 4px;
}

/* Figma 133:765 — 300×420, stroke #F2F2F2 1px, FILL/cover */
.company-cert-card__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 300 / 420;
  overflow: hidden;
  border: 1px solid #f2f2f2;
  background-color: #f7f7f7;
  box-sizing: border-box;
}

.company-cert-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

.company-cert-card:hover .company-cert-card__image,
.company-cert-card:focus-visible .company-cert-card__image {
  transform: scale(1.03);
}

.company-cert-card__title {
  display: block;
  width: 100%;
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #333;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.company-cert__message {
  grid-column: 1 / -1;
  margin: 0;
  padding: 32px 0;
  text-align: center;
  font-size: clamp(16px, 0.94vw, 18px);
  line-height: 1.6;
  color: #666;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* Lightbox */

.cert-lightbox[hidden] {
  display: none;
}

.cert-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-lightbox__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.82);
  cursor: pointer;
}

.cert-lightbox__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 960px);
  height: min(94vh, 1080px);
  padding: 48px 64px;
  box-sizing: border-box;
}

.cert-lightbox__figure {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  width: 100%;
  height: 100%;
}

.cert-lightbox__image {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background-color: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  user-select: none;
  -webkit-user-drag: none;
  touch-action: pan-y;
}

.cert-lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color 0.2s ease;
}

.cert-lightbox__nav:hover,
.cert-lightbox__nav:focus-visible {
  background-color: rgba(255, 255, 255, 0.28);
  outline: none;
}

.cert-lightbox__nav--prev {
  left: 0;
}

.cert-lightbox__nav--next {
  right: 0;
}

.cert-lightbox__close {
  position: absolute;
  top: -8px;
  right: 0;
  z-index: 2;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.cert-lightbox__close:hover,
.cert-lightbox__close:focus-visible {
  background-color: rgba(255, 255, 255, 0.28);
  outline: none;
}

body.cert-lightbox-open {
  overflow: hidden;
}

@media (max-width: 1023px) {
  .company-cert__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 32px;
  }

  .company-cert-card {
    gap: 18px;
  }

  .company-cert-card__title {
    font-size: clamp(16px, 1.8vw, 18px);
  }

  .cert-lightbox__dialog {
    width: min(100%, 720px);
    padding: 40px 52px;
  }
}

@media (max-width: 767px) {
  .company-cert__inner {
    gap: 32px;
  }

  .company-cert__title {
    font-size: clamp(24px, 7vw, 32px);
  }

  .company-cert__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 24px;
  }

  .company-cert-card {
    gap: 14px;
  }

  .company-cert-card__title {
    font-size: 15px;
  }

  .cert-lightbox__dialog {
    width: min(100%, 100vw);
    height: min(92vh, 900px);
    padding: 52px 40px 24px;
  }

  .cert-lightbox__nav {
    width: 36px;
    height: 36px;
    font-size: 28px;
  }

  .cert-lightbox__close {
    top: 4px;
    right: 8px;
  }
}

@media (max-width: 479px) {
  .company-cert__grid {
    grid-template-columns: minmax(0, 300px);
    justify-content: center;
    column-gap: 0;
  }
}
