/* ═══════════════════════════════════════════════════════════════
 *  skins/main/default/style.css
 *  1열 스택 메인 스킨의 모든 스타일
 *  - 모든 색상은 :root 의 CSS 변수 (테마)에서 가져옴
 *  - 따로 색을 정의하지 않아 4종 테마 모두에서 자동 동작
 * ═══════════════════════════════════════════════════════════════ */

/* ─ wrap & stack ─ */
.home-wrap {
  padding: 32px 24px 40px;
}
.home-stack {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
/* 기본: 모든 블록은 한 줄 통째로 차지 */
.home-stack > * {
  flex: 1 1 100%;
  min-width: 0;
}
/* 프로필 + 최근글은 절반씩 → 같은 줄에 나란히. 둘 중 하나만 있으면 자동으로 전체 폭 */
.home-stack > .profile-card,
.home-stack > .home-card.recent {
  flex: 1 1 calc(50% - 10px);
}
@media (max-width: 768px) {
  .home-stack > .profile-card,
  .home-stack > .home-card.recent {
    flex: 1 1 100%;
  }
}

/* ─ 공통 카드 ─ */
.home-card {
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 24px 26px 22px;
  position: relative;
}
.home-block-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: .15em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.home-block-label .more {
  font-size: 11px;
  color: var(--ink-mute);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  text-decoration: none;
}
.home-block-label .more:hover { color: var(--accent); }

/* ─ 드래그 핸들 (관리자 모드 전용) ─ */
.drag-handle {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-mute);
  font-family: 'Material Symbols Rounded';
  font-size: 16px;
  cursor: grab;
  opacity: .35;
  transition: all .15s ease;
  user-select: none;
}
.drag-handle:hover {
  opacity: 1;
  background: var(--hair-soft);
  color: var(--accent);
}

/* ─ profile card ─ */
.profile-card {
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 32px 24px 26px;
  text-align: center;
  position: relative;
}
.profile-card .avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  border: 3px solid var(--paper);
  overflow: hidden;
}
.profile-card .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.profile-card .avatar .ic {
  font-family: 'Material Symbols Rounded';
  font-size: 40px;
}
.profile-card .greet {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: -.01em;
}
.profile-card .intro {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 4px;
}
.profile-card .note {
  font-size: 11px;
  color: var(--ink-mute);
  line-height: 1.6;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--hair);
}

/* ─ own banner (200x40 동인 표준) ─ */
.own-banner {
  display: block;
  width: 200px;
  height: 40px;
  margin: 18px auto 0;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,.15);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  background: var(--hair-soft);
  transition: transform .2s ease;
  text-decoration: none;
}
.own-banner:hover { transform: translateY(-1px); }
.own-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 자동 배너 — 업로드 안 했을 때 accent + accent-2 그라데이션 폴백 */
.own-banner-auto {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.own-banner-auto::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.25), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,.15), transparent 50%);
  pointer-events: none;
}

/* ─ social row ─ */
.social-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}
.social-row a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--hair);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
}
.social-row a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.social-row a .ic {
  font-family: 'Material Symbols Rounded';
  font-size: 18px;
}

/* ─ recent posts ─ */
.home-card.recent .recent-item {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--hair-soft);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  transition: padding-left .15s ease;
}
.home-card.recent .recent-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.home-card.recent .recent-item:first-of-type { padding-top: 0; }
.home-card.recent .recent-item:hover { padding-left: 4px; }
.home-card.recent .recent-item:hover .t { color: var(--accent); }
.recent-item .cat {
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
  width: 44px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.recent-item .t {
  flex: 1;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .15s;
}
.recent-item .d {
  font-size: 11px;
  color: var(--ink-mute);
  font-weight: 500;
}

/* ─ guestbook ─ */
.home-card.guestbook .gb-list { }
.gb-entry {
  padding: 14px 0;
  border-bottom: 1px solid var(--hair-soft);
  font-size: 12px;
}
.gb-entry:first-child { padding-top: 4px; }
.gb-entry:last-child { border-bottom: none; padding-bottom: 4px; }
.gb-entry .head {
  display: flex;
  gap: 10px;
  margin-bottom: 5px;
  align-items: baseline;
}
.gb-entry .who {
  font-weight: 700;
  color: var(--ink);
  font-size: 13px;
}
.gb-entry .when {
  font-size: 10px;
  color: var(--ink-mute);
  margin-left: auto;
  font-weight: 500;
}
.gb-entry .body {
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ─ friends grid (실제 200x40 이미지 배너) ─ */
.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.friend-banner {
  display: block;
  width: 100%;
  height: 38px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--hair);
  background: var(--hair-soft);
  transition: transform .15s ease;
  text-decoration: none;
}
.friend-banner:hover { transform: translateY(-1px); }
.friend-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ─ tags ─ */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 6px;
}
.tag-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s;
  text-decoration: none;
}
.tag-chip:hover { transform: translateY(-1px); }
.tag-chip.lg { font-size: 14px; padding: 8px 14px; }
.tag-chip.sm { font-size: 11px; padding: 5px 10px; opacity: .75; }

/* ─ custom html ─ */
.home-card.custom-html .custom-content {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.65;
}

/* ─ 빈 상태 ─ */
.home-card .empty-msg {
  font-size: 12px;
  color: var(--ink-mute);
  padding: 8px 0;
  text-align: center;
}

/* ─ 모바일 반응형 ─ */
@media (max-width: 768px) {
  .home-wrap {
    padding: 20px 14px 32px;
  }
  .home-stack { gap: 14px; }
  .home-card { padding: 20px 18px 18px; border-radius: 12px; }
  .profile-card { padding: 26px 20px 22px; border-radius: 12px; }
  .profile-card .avatar { width: 76px; height: 76px; }
  .profile-card .avatar .ic { font-size: 34px; }
  .profile-card .greet { font-size: 13px; }
  .profile-card .intro { font-size: 11px; }
  .own-banner { width: 200px; }
  .social-row a { width: 34px; height: 34px; }
  .home-block-label { font-size: 10px; margin-bottom: 12px; }
  .recent-item { font-size: 12px; gap: 10px; }
  .recent-item .cat { width: 38px; font-size: 9px; }
  .gb-entry { font-size: 11px; padding: 12px 0; }
  .gb-entry .who { font-size: 12px; }
  .friends-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
  .friend-banner { height: 36px; }
}
