/* =====================================================================
   «Θέλω να» (Figma "Θέλω να" + "Want Tile")
   Tiles wrap and stay centred: 240px on desktop, they grow between 190 and 260px on tablets
   (3 per row) and shrink to 2 per row on phones. --need-to-per-row (template) caps a row at 5,
   or at 4 when 5 would leave a lone tile (6 -> 4 + 2).
   ===================================================================== */

#need-to {
  background-color: var(--sf-brand);
}

#need-to .need-to-heading {
  display: flex;
  flex-direction: column;
  gap: var(--sf-gap-xs);
  margin-bottom: var(--sf-gap-xl);
  text-align: center;
}

#need-to .sf-section-title {
  color: var(--sf-on-dark);
}

#need-to .need-to-wrapper {
  --need-to-tile: clamp(140px, 12vw + 98px, 240px);

  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: var(--sf-gap-lg);
  max-width: calc(var(--need-to-per-row, 5) * 240px + (var(--need-to-per-row, 5) - 1) * var(--sf-gap-lg));
  margin-inline: auto;
}

/* ----- Tile ----- */
#need-to .need-to-tile {
  display: flex;
  flex: 1 1 var(--need-to-tile);
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 260px;
  min-height: 236px;
  padding: 28px 20px 24px;
  background: var(--sf-surface);
  border-radius: var(--sf-radius);
  box-shadow: var(--sf-shadow-tile);
  text-align: center;
  text-decoration: none;
  transition: box-shadow var(--sf-transition);
}

#need-to .need-to-tile img {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

#need-to .need-to-box-title {
  margin: 0;
  color: var(--sf-brand-dark);
  font-size: var(--sf-fs-tile);
  font-weight: 700;
  line-height: var(--sf-lh-card);
  transition: color var(--sf-transition);
}

#need-to .need-to-box-content {
  margin: 0;
  color: var(--sf-text-muted);
  font-size: var(--sf-fs-sm);
  line-height: var(--sf-lh-small);
}

/* Hover: dark orange frame inside the tile (no layout shift) + deeper shadow */
#need-to .need-to-tile:hover {
  box-shadow: inset 0 0 0 2px var(--sf-accent-dark), var(--sf-shadow-tile-hover);
}

#need-to .need-to-tile:hover .need-to-box-title {
  color: var(--sf-brand-deep);
}

/* Focus on the blue background: white ring */
#need-to .need-to-tile:focus-visible {
  outline: 3px solid var(--sf-on-dark);
  outline-offset: 3px;
}

#need-to .need-to-empty {
  margin: 0;
  color: var(--sf-on-dark);
}

/* ----- Phones: two compact columns ----- */
@media (max-width: 575.98px) {
  #need-to .need-to-tile {
    min-height: 0;
    padding: 20px 12px;
  }

  #need-to .need-to-tile img {
    width: 52px;
    height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #need-to .need-to-tile,
  #need-to .need-to-box-title {
    transition: none;
  }
}
