/* ============================================================
   T13 · Word cloud layout engine
   Grid spans are driven by data-cols only (no inline styles).
   ============================================================ */

.cloud {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 98px;
  grid-auto-flow: dense;
  gap: 14px;
}

.cloud[data-cols="8"] { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.cloud[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cloud[data-cols="1"] { grid-template-columns: 1fr; }

.cloud-card {
  color: inherit;
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
}
.cloud-card:hover,
.cloud-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.cloud-card__rank {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--text-soft);
}

.cloud-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.cloud-card__desc {
  margin: 0;
  overflow: hidden;
}

.cloud-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .05em;
  color: rgba(15, 44, 56, .52);
}

/* 12 columns */
.cloud[data-cols="12"] .is-xl { grid-column: span 6; grid-row: span 3; }
.cloud[data-cols="12"] .is-l  { grid-column: span 5; grid-row: span 2; }
.cloud[data-cols="12"] .is-m  { grid-column: span 4; grid-row: span 2; }
.cloud[data-cols="12"] .is-s  { grid-column: span 3; grid-row: span 2; }
.cloud[data-cols="12"] .is-xs { grid-column: span 3; grid-row: span 1; }

/* 8 columns */
.cloud[data-cols="8"] .is-xl { grid-column: span 4; grid-row: span 3; }
.cloud[data-cols="8"] .is-l  { grid-column: span 4; grid-row: span 2; }
.cloud[data-cols="8"] .is-m  { grid-column: span 3; grid-row: span 2; }
.cloud[data-cols="8"] .is-s  { grid-column: span 2; grid-row: span 2; }
.cloud[data-cols="8"] .is-xs { grid-column: span 2; grid-row: span 1; }

/* 4 columns */
.cloud[data-cols="4"] .is-xl { grid-column: span 4; grid-row: span 3; }
.cloud[data-cols="4"] .is-l  { grid-column: span 3; grid-row: span 2; }
.cloud[data-cols="4"] .is-m,
.cloud[data-cols="4"] .is-s  { grid-column: span 2; grid-row: span 2; }
.cloud[data-cols="4"] .is-xs { grid-column: span 2; grid-row: span 1; }

/* 1 column */
.cloud[data-cols="1"] .is-xl { grid-row: span 3; }
.cloud[data-cols="1"] .is-l,
.cloud[data-cols="1"] .is-m,
.cloud[data-cols="1"] .is-s  { grid-row: span 2; }
.cloud[data-cols="1"] .is-xs { grid-row: span 1; }

/* type scale */
.is-xl .cloud-card__title { font-size: 27px; }
.is-l  .cloud-card__title { font-size: 21px; }
.is-m  .cloud-card__title { font-size: 18px; }
.is-s  .cloud-card__title { font-size: 16px; }
.is-xs .cloud-card__title { font-size: 15px; }

.is-xs .cloud-card__desc { display: none; }
.is-xs .cloud-card__meta {
  border-top: 0;
  padding-top: 0;
  margin-top: 8px;
}

/* pager */
.cloud-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.cloud-pager__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.cloud-pager__btn:hover { border-color: var(--ink); background: rgba(15, 44, 56, .04); }
.cloud-pager__now {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--text-soft);
}

@media (max-width: 760px) {
  .is-xl .cloud-card__title { font-size: 22px; }
  .is-l  .cloud-card__title { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .cloud-card { transition: none; }
  .cloud-card:hover,
  .cloud-card:focus-visible { transform: none; }
}
