/**
 * v1 랜딩 (/v1/) — 타일 메뉴 + 게시판 (index.php)
 */
:root {
  --page-max: 1100px;
  --page-bg: #eceff4;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --tile-radius: 18px;
  --tile-shadow: 0 2px 8px rgba(15, 23, 42, 0.06),
    0 12px 32px rgba(15, 23, 42, 0.06);
  --tile-shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.1);
  --border: rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial,
    sans-serif;
  background: var(--page-bg);
  color: var(--text);
  min-height: 100vh;
}

.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-left, 0px))
    max(40px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-right, 0px));
}

/* Board 전용 랜딩(?board=1): 타일 미렌더 대비 보조 숨김 */
body.v1-landing-board-only .module-launcher {
  display: none !important;
}

.v1-global-bar {
  background: var(--page-bg);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.module-launcher {
  margin-bottom: 22px;
}

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

@media (max-width: 1024px) {
  .tile-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 360px) {
  .tile-grid {
    gap: 8px;
  }
}

.tile {
  --tile-accent: #64748b;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border-radius: var(--tile-radius);
  border: 1px solid var(--border);
  box-shadow: var(--tile-shadow);
  padding: 16px 14px 20px;
  min-height: 132px;
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.15s ease;
  overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
  .tile:hover {
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: var(--tile-shadow-hover);
    transform: translateY(-2px);
  }
}

.tile:active {
  transform: translateY(0);
}

.tile:focus-visible {
  outline: 2px solid #175e7d;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .tile {
    transition: none;
  }
  @media (hover: hover) and (pointer: fine) {
    .tile:hover {
      transform: none;
    }
  }
}

.tile-icon-well {
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 12px;
  font-size: 1.65rem;
  line-height: 1;
  font-family: system-ui, "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji",
    sans-serif;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

@media (max-width: 640px) {
  .tile {
    min-height: 118px;
    padding: 12px 10px 18px;
  }
  .tile-icon-well {
    width: 48px;
    height: 48px;
    font-size: 1.45rem;
    margin-bottom: 10px;
    border-radius: 12px;
  }
}

.tile-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  min-width: 0;
}

.tile-title {
  font-weight: 700;
  font-size: clamp(0.95rem, 2.8vw, 1.05rem);
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text);
}

.tile-sub {
  font-size: clamp(0.68rem, 2.1vw, 0.8rem);
  font-weight: 500;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.tile-sub:empty {
  display: none;
}

.tile-arrow {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.75;
  color: var(--tile-accent);
  pointer-events: none;
}

.board-wrap {
  margin-top: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--tile-radius);
  box-shadow: var(--tile-shadow);
  padding: 18px 16px 20px;
}

.board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}

.board-head-spacer {
  width: 40px;
  flex-shrink: 0;
}

.board-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  flex: 1;
  text-align: center;
  letter-spacing: -0.02em;
}

.board-head a.write {
  font-size: 0.9rem;
  font-weight: 600;
  color: #175e7d;
  text-decoration: none;
  white-space: nowrap;
}

.board-head a.write:hover {
  text-decoration: underline;
}

.board-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.board-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid #e5e7eb;
  gap: 12px;
}

.board-list li:last-child {
  border-bottom: none;
}

.board-list li a {
  color: #111827;
  text-decoration: none;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.board-list li a:hover {
  color: #175e7d;
}

.board-list .co {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-list .dt {
  color: #64748b;
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.err {
  color: #b91c1c;
  margin: 12px 0;
}

footer.site-f {
  margin-top: 36px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.staff {
  text-align: center;
  margin-top: 14px;
  font-size: 0.8rem;
}

.staff a {
  color: #175e7d;
}

.board-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
  font-size: 0.9rem;
}

.board-pager a {
  color: #175e7d;
  text-decoration: none;
  min-width: 2rem;
  text-align: center;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.board-pager a:hover {
  background: rgba(23, 94, 125, 0.08);
  border-color: rgba(23, 94, 125, 0.2);
}

.board-pager .cur {
  font-weight: 700;
  color: #111;
  min-width: 2rem;
  text-align: center;
  padding: 6px 10px;
  border-radius: 8px;
  background: #e8ecf0;
}
