/* Mobile layout fixes for winner lists. Desktop (1024px+) is left unchanged. */

/* The year-tab row sits at the bottom of the hero on a single-column layout.
   Hero py-16 plus the following .section padding-top stacked into a ~150px
   black gap between the tabs and the first category. Tighten only below lg. */
@media (max-width: 1023px) {
  section.winners-year-hero {
    padding-top: 2.5rem;
    padding-bottom: 1.25rem;
  }

  section.winners-year-hero .grid.gap-12 {
    row-gap: 1.25rem;
  }

  section.winners-year-list.section {
    padding-top: 1.5rem;
  }
}

/* Grid items default to min-width:auto, so a nowrap company name forces the
   whole category grid (and its cards) wider than the viewport. */
.winners-year-list .grid {
  min-width: 0;
}

.winners-year-list .grid > * {
  min-width: 0;
  max-width: 100%;
}

.winners-year-list a.block.bg-white {
  max-width: 100%;
  min-width: 0;
}

.winners-year-list a.block.bg-white > .flex {
  min-width: 0;
  max-width: 100%;
}

/* Let long names wrap to two lines with a clean ellipsis instead of
   running into the trailing arrow or overflowing the screen. */
.winners-year-list a.block.bg-white h4 {
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-overflow: ellipsis;
  overflow-wrap: break-word;
}

/* On phones the 9rem logo slot leaves too little room for a two-line name
   (e.g. Γραφείο Πωλήσεων Κλαράκη Εμμανουήλ). Shrink the slot below sm only. */
@media (max-width: 639px) {
  .winners-year-list a.block.bg-white .w-36.h-20 {
    width: 6.75rem;
    height: 3.75rem;
  }

  .winners-year-list a.block.bg-white .text-xs.uppercase {
    white-space: nowrap;
  }
}

/* At ~360px a two-line clamp still cuts "Γραφείο Πωλήσεων Κλαράκη Εμμανουήλ"
   mid-word. Allow a third line on the narrowest phones. */
@media (max-width: 399px) {
  .winners-year-list a.block.bg-white h4 {
    -webkit-line-clamp: 3;
  }
}
