/* 홈 바로가기: 아이콘 타일 + 이름. 항목 목록은 templates/search.html 의 home_shortcuts. */
.home-shortcuts {
  --hs-tile: #f3f6f4;
  --hs-line: #e1e7e3;
  --hs-icon: #0f7a52;
  --hs-accent: #10b981;
  --hs-text: #1f2a24;
  --hs-ring: #fff;
  display: grid;
  /* 항목 수의 절반씩 두 줄로 나눠 빈칸이 생기지 않게 한다(--hs-columns는 search.html에서 계산). */
  grid-template-columns: repeat(var(--hs-columns, 6), minmax(0, 1fr));
  gap: 14px 4px;
  width: 100%;
  margin: 0;
  padding: 0;
}

html[data-theme="dark"] .home-shortcuts {
  --hs-tile: #172033;
  --hs-line: #2b3a52;
  --hs-icon: #34d399;
  --hs-accent: #34d399;
  --hs-text: #e4eaf2;
  --hs-ring: #0b1422;
}

.home-shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 2px 0;
  color: var(--hs-text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.home-shortcut-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--hs-line);
  border-radius: 16px;
  background: var(--hs-tile);
  color: var(--hs-icon);
  font-size: 22px;
  transition: border-color .15s ease, transform .15s ease;
}

.home-shortcut-icon i { line-height: 1; }

/* 부트스트랩 아이콘에 없는 모양은 SVG를 마스크로 써서 같은 초록색을 입힌다. */
.home-shortcut-svg {
  width: 1.2em;
  height: 1.2em;
  background: currentColor;
  -webkit-mask: var(--hs-svg) center / contain no-repeat;
  mask: var(--hs-svg) center / contain no-repeat;
}

.home-shortcut.is-new .home-shortcut-icon {
  border: 1.5px solid var(--hs-accent);
}

.home-shortcut.is-new .home-shortcut-icon::after {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--hs-ring);
  border-radius: 50%;
  background: #ef4444;
  content: "";
}

.home-shortcut-label {
  max-width: 100%;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: hover) {
  .home-shortcut:hover .home-shortcut-icon { border-color: var(--hs-accent); }
}

.home-shortcut:active .home-shortcut-icon { transform: scale(.95); }

.home-shortcut:focus-visible { outline: none; }
.home-shortcut:focus-visible .home-shortcut-icon {
  outline: 2px solid var(--hs-accent);
  outline-offset: 2px;
}

/* 모바일: 스크롤 없이 두 줄(목록 앞쪽 절반이 윗줄). 칸이 좁아 이름은 띄어쓰기에서 두 줄로 접는다. */
@media (max-width: 640px) {
  .home-shortcuts { gap: 10px 2px; }

  .home-shortcut { gap: 5px; }

  .home-shortcut-icon {
    width: min(40px, 100%);
    height: auto;
    aspect-ratio: 1;
    border-radius: 12px;
    font-size: 18px;
  }

  .home-shortcut.is-new .home-shortcut-icon::after {
    width: 8px;
    height: 8px;
  }

  .home-shortcut-label {
    overflow: visible;
    font-size: 11px;
    letter-spacing: -0.05em;
    text-align: center;
    white-space: normal;
    word-break: keep-all;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-shortcut-icon { transition: none; }
  .home-shortcut:active .home-shortcut-icon { transform: none; }
}

/* AI 기능 표시: 아이콘 오른쪽 위에 작은 반짝이 두 개. 사람 아이콘은 그만큼 왼쪽 아래로 비킨다. */
.home-shortcut-icon:has(.home-shortcut-ai) > i { transform: translate(-2px, 2px); }

.home-shortcut-ai {
  position: absolute;
  top: 18%;
  right: 16%;
  width: 34%;
  height: 34%;
  fill: currentColor;
  pointer-events: none;
}
