.honor-showcase {
  --honor-columns: 4;
  --honor-gap: 24px;
  --honor-padding: 10%;
  --honor-aspect: 4 / 3;
  position: relative;
}
.honor-showcase[data-ratio="portrait"] { --honor-aspect: 3 / 4; }
.honor-showcase[data-ratio="landscape"] { --honor-aspect: 4 / 3; }
.honor-showcase[data-ratio="square"] { --honor-aspect: 1 / 1; }
.honor-showcase[data-ratio="auto"] { --honor-aspect: 1 / 1.06; }
.honor-showcase[data-ratio="auto"][data-resolved-ratio="portrait"] { --honor-aspect: 3 / 4; }
.honor-showcase[data-ratio="auto"][data-resolved-ratio="landscape"] { --honor-aspect: 4 / 3; }

.honor-filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 0 36px;
}
.honor-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border: 1px solid #dce5f2;
  border-radius: 999px;
  background: #ffffff;
  color: #526075;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .22s ease;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .03);
}
.honor-filter-btn span {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eff4fb;
  color: #4385ff;
  font-size: 11px;
  font-weight: 700;
}
.honor-filter-btn:hover {
  border-color: #9dc0ff;
  color: #2563eb;
  transform: translateY(-1px);
}
.honor-filter-btn.is-active {
  border-color: #2563eb;
  background: linear-gradient(135deg, #2563eb, #4385ff);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .24);
}
.honor-filter-btn.is-active span {
  background: rgba(255, 255, 255, .22);
  color: #ffffff;
}

.honor-grid {
  display: grid;
  grid-template-columns: repeat(var(--honor-columns, 4), minmax(0, 1fr));
  gap: var(--honor-gap, 24px);
  align-items: stretch;
}

.honor-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, .9);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .03);
  overflow: hidden;
  transition: transform .28s cubic-bezier(.22, 1, .36, 1), box-shadow .28s ease, border-color .28s ease;
}
.honor-card[hidden] { display: none !important; }
.honor-card:hover {
  transform: translateY(-6px);
  border-color: rgba(67, 133, 255, .45);
  box-shadow: 0 20px 40px -12px rgba(30, 64, 175, .14), 0 4px 12px rgba(15, 23, 42, .04);
}

.honor-frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--honor-aspect, 4 / 3);
  padding: clamp(12px, 1.8vw, 20px);
  box-sizing: border-box;
  background: linear-gradient(145deg, #f6f8fc 0%, #edf2f9 100%);
  border-bottom: 1px solid #eef2f8;
  overflow: hidden;
}
.honor-frame[role="button"] { cursor: zoom-in; }

/* Frame styles: mat (gallery mount), clean (minimal), gold (classic honor border) */
.honor-showcase[data-frame="mat"] .honor-mat {
  position: relative;
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid rgba(203, 213, 225, .65);
  box-shadow: inset 0 0 0 4px #f8fafc, 0 8px 24px rgba(15, 23, 42, .07);
}
.honor-showcase[data-frame="clean"] .honor-frame {
  padding: 0;
  background: #f8fafc;
}
.honor-showcase[data-frame="clean"] .honor-mat {
  position: relative;
  width: 100%;
  height: 100%;
  background: #ffffff;
}
.honor-showcase[data-frame="gold"] .honor-frame {
  background: linear-gradient(145deg, #fbf9f4 0%, #f2ece1 100%);
}
.honor-showcase[data-frame="gold"] .honor-mat {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fffdf9;
  border-radius: 6px;
  border: 1px solid #d9c398;
  box-shadow: inset 0 0 0 4px #faf5eb, inset 0 0 0 5px rgba(212, 175, 55, .3), 0 10px 26px rgba(120, 90, 40, .1);
}

.honor-artwork {
  position: absolute;
  inset: var(--honor-padding, 10%);
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
}
.honor-showcase[data-ratio="auto"] .honor-card[data-orientation="portrait"] .honor-artwork,
.honor-showcase[data-ratio="auto"] .honor-card[data-auto-orientation="portrait"] .honor-artwork {
  inset: calc(var(--honor-padding, 10%) * 0.45) calc(var(--honor-padding, 10%) * 0.85);
}
.honor-showcase[data-ratio="auto"] .honor-card[data-orientation="landscape"] .honor-artwork,
.honor-showcase[data-ratio="auto"] .honor-card[data-auto-orientation="landscape"] .honor-artwork {
  inset: calc(var(--honor-padding, 10%) * 0.85) calc(var(--honor-padding, 10%) * 0.45);
}
.honor-artwork > img,
.honor-artwork > .logo-cropped {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, .08));
}
.honor-card:hover .honor-artwork > img,
.honor-card:hover .honor-artwork > .logo-cropped {
  transform: scale(1.045);
}

.honor-mat {
  overflow: hidden;
}
.honor-mat::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.65) 48%,
    rgba(191, 219, 254, 0.35) 52%,
    transparent 65%
  );
  transform: translateX(-120%) rotate(12deg);
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 2;
}
.honor-card:hover .honor-mat::after {
  transform: translateX(120%) rotate(12deg);
}
.honor-card.is-filtering-in {
  animation: honor-card-in 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes honor-card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.honor-zoom-badge {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(15, 23, 42, .68);
  color: #ffffff;
  opacity: 0;
  transform: scale(.88);
  transition: opacity .22s ease, transform .22s ease, background .2s ease;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.honor-card:hover .honor-zoom-badge,
.honor-frame:focus-visible .honor-zoom-badge {
  opacity: 1;
  transform: scale(1);
}

.honor-caption {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px 20px;
  flex: 1;
}
.honor-tag {
  align-self: flex-start;
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(67, 133, 255, .1);
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}
.honor-title {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: #1e293b;
  overflow-wrap: anywhere;
}
.honor-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin: auto 0 0;
  padding-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
  border-top: 1px dashed rgba(203, 213, 225, .6);
}
.honor-meta time {
  font-family: ui-monospace, 'DM Mono', SFMono-Regular, Consolas, monospace;
  color: #94a3b8;
}

/* Lightbox modal for high-res certificate inspection */
.honor-lightbox {
  position: fixed;
  inset: 0;
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 20px;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 32px 90px rgba(0, 0, 0, .55);
  overflow: hidden;
}
.honor-lightbox::backdrop {
  background: rgba(9, 13, 24, .78);
  backdrop-filter: blur(8px);
}
.honor-lightbox-inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 40px);
}
.honor-lightbox-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
  max-height: calc(100dvh - 150px);
  padding: 28px;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  overflow: auto;
}
.honor-lightbox-stage img {
  display: block;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: calc(100dvh - 210px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
  padding: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
.honor-lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: #131c31;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.honor-lightbox-info h3 {
  margin: 0;
  font-size: 16px;
  color: #ffffff;
}
.honor-lightbox-info p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #94a3b8;
}
.honor-lightbox-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease;
}
.honor-lightbox-close:hover {
  background: rgba(255, 255, 255, .2);
}

@media (max-width: 1024px) {
  .honor-grid {
    grid-template-columns: repeat(min(var(--honor-columns, 4), 3), minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .honor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .honor-caption {
    padding: 14px;
  }
  .honor-title {
    font-size: 14px;
  }
}
@media (max-width: 420px) {
  .honor-grid {
    grid-template-columns: 1fr;
  }
}
