/* frontend/css/views/home.css — accueil en tuiles (design/maquettes/C_Accueil.dc.html et
   C_Accueil_Sombre.dc.html). Mesures de la maquette 390×844 : marges 20 px, grille 2 colonnes
   espacées de 12 px, tuiles de 214 / 84 / 116 / 124 px de haut, rayon 28 px.
   Les textes venus de l'API sont coupés (2 lignes, ou points de suspension) pour garder la
   grille intacte et ne jamais passer sous les boutons ronds.
   Écart voulu : la Phrase du jour fait 84 px AU MOINS (min-height), comme la maquette pour une
   phrase d'une ligne. Une phrase plus longue (jusqu'à 200 caractères) passe en 20 px et la tuile
   grandit jusqu'à 3 lignes (environ 125 px) : à 84 px fixes, il ne reste qu'une ligne de 28 px
   sous l'étiquette, et la phrase serait coupée. */

.home {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- En-tête ---------- */

.home__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.home__titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.home__date {
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  color: var(--mute);
}
.home__hello {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 34px;
  line-height: 36px;
  letter-spacing: -0.01em;
}
.home__settings { flex: none; }

/* Conseil du cycle : ligne fine sous l'en-tête (hors maquette ; compte avec cycle seulement). */
.home__tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: -4px;
  font-size: 13px;
  line-height: 17px;
  color: var(--mute);
}
.home__tip-icon {
  flex: none;
  margin-top: 1px;
  color: var(--ink);
}

/* ---------- Grille et tuiles ---------- */

.home__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home .tile { transition: transform 120ms ease; }
.home a.tile:active,
.home .tile:has(> .tile__link:active) { transform: scale(0.985); }

/* Lien qui couvre toute la tuile quand un bouton rond est posé dessus (bouton frère, jamais
   imbriqué dans le lien). */
.tile__link {
  position: absolute;
  inset: 0;
  border-radius: var(--r-tile);
  display: flex;
  flex-direction: column;
  color: inherit;
}

/* Tâches (2×2) */
.tasks-tile {
  grid-column: span 2;
  height: 214px;
}
.tasks-tile__link { padding: 18px; }
.tasks-tile__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tasks-tile__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
}
.tasks-tile__icon {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: var(--glass);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tasks-tile__count {
  font-size: 12px;
  font-weight: 500;
  color: var(--mute);
  white-space: nowrap;
}
.tasks-tile__eyebrow { margin-top: 14px; }
.tasks-tile__now {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  max-width: min(236px, calc(100% - 78px));
}
.tasks-tile__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  line-height: 27px;
}
.tasks-tile__meta {
  font-size: 13px;
  line-height: 17px;
  color: var(--mute);
}
.tasks-tile__pill {
  margin-top: auto;
  align-self: flex-start;
  max-width: calc(100% - 78px);
}
.tasks-tile__action {
  position: absolute;
  right: 18px;
  bottom: 18px;
}

/* Phrase du jour (2×1) */
.phrase-tile {
  grid-column: span 2;
  min-height: 84px;
  padding: 16px 18px;
  overflow: hidden;
  justify-content: center;
  gap: 6px;
}
.phrase-tile__deco {
  position: absolute;
  right: -34px;
  top: -34px;
}
.phrase-tile__label,
.phrase-tile__text { position: relative; }
.phrase-tile__text {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  line-height: 28px;
}
.phrase-tile__text.is-long { font-size: 20px; line-height: 24px; }
.phrase-tile__text.is-empty { font-size: 18px; line-height: 22px; }

/* Petites tuiles (Repas, Budget, Assistant) */
.small-tile {
  height: 116px;
  padding: 14px;
  overflow: hidden;
}
.small-tile__title {
  margin-top: 6px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  line-height: 20px;
}
.small-tile__title.is-empty { color: var(--mute); }
.small-tile__foot {
  margin-top: auto;
  font-size: 12px;
  line-height: 15px;
  color: var(--mute);
}

/* Budget */
.budget-tile { gap: 8px; }
.budget-tile__row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.budget-tile__nums {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
/* Montant en euros entiers (home.js) : 22 px jusqu'à « 999 € », 18 px pour « 1 234 € »,
   15 px au-delà. Les points de suspension ne servent que de filet (jamais un montant coupé
   sans signe visible). */
.budget-tile__amount {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  line-height: 25px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.budget-tile__amount.is-long { font-size: 18px; line-height: 22px; }
.budget-tile__amount.is-xlong { font-size: 15px; line-height: 22px; }
.budget-tile__amount.is-empty { font-size: 18px; line-height: 22px; }
.budget-tile__line {
  font-size: 12px;
  line-height: 15px;
  color: var(--mute);
}
.budget-tile__line.is-over { color: var(--danger); font-weight: 600; }

/* Moment récent */
.moment-tile { height: 124px; }
.moment-tile__link { padding: 12px 14px; }
/* 2 px et 18 px au lieu des 4 px / 19 px de la maquette (qui n'a qu'une ligne) : une 2e ligne
   s'arrête ainsi au-dessus du bouton rond « Garder un moment » (haut du bouton à 68 px). */
.moment-tile__text {
  margin-top: 2px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
  line-height: 18px;
}
.moment-tile__text.is-empty { color: var(--mute); }
.moment-tile__foot {
  margin-top: auto;
  max-width: calc(100% - 50px);
  display: flex;
  flex-direction: column;
  font-size: 12px;
  line-height: 15px;
  color: var(--mute);
}
.moment-tile__keep {
  position: absolute;
  right: 12px;
  bottom: 12px;
}

/* Assistant repas */
.assistant-tile { height: 124px; }
.assistant-tile__foot {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Chargement ---------- */

.home__sk-date { display: block; width: 150px; height: 14px; border-radius: 7px; margin-bottom: 6px; }
.home__sk-title { display: block; width: 170px; height: 32px; border-radius: 12px; }
.skeleton-tile {
  animation: skeleton-pulse 1.4s ease-in-out infinite;
  box-shadow: none;
}
.skeleton-tile.moment-tile:last-child { animation-delay: 0.2s; }
