/* Tiles: departments' categories and brands. A whole tile is one link; the photo or a
   monogram on a fixed square, so tiles keep their size while images load. */

@layer components {
.lede { max-width: 46rem; color: var(--muted); font-size: 1.05rem; margin-top: 0; }
.tiles {
  list-style: none; padding: 0; margin: var(--space-5) 0 var(--space-6);
  display: grid; gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
}
.tile__link {
  display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--bg); color: var(--text); text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  &:hover { border-color: var(--orange); box-shadow: 0 8px 22px rgb(20 33 61 / 0.1); transform: translateY(-2px); }
  &:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
}
.tile__media {
  /* A fixed box: min-height 0 and the image taken out of the flow keep every photo,
     portrait or landscape, inside the same frame (aspect-ratio alone lets a tall
     image stretch the box). */
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; min-height: 0;
  overflow: hidden; background: #fff; border-bottom: 1px solid var(--line);
  & img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: var(--space-3); box-sizing: border-box; }
}
.tile__monogram {
  display: grid; place-items: center; width: 4.5rem; height: 4.5rem; border-radius: 999px;
  background: var(--navy); color: #fff; font-weight: 800; font-size: 1.6rem;
  font-stretch: 110%; letter-spacing: 0.02em; text-transform: uppercase;
}
.tile__body { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) var(--space-4) var(--space-4); }
.tile__title { font-weight: 800; font-size: 1.1rem; font-stretch: 105%; letter-spacing: 0.01em; overflow-wrap: anywhere; hyphens: auto; }
.tile__text { color: var(--muted); font-size: 0.9rem; line-height: 1.4; }
.tile__meta { margin-top: auto; padding-top: var(--space-2); font-size: 0.8rem; font-weight: 600; color: var(--muted); }
}

@layer components {
.tiles--brands { grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); }
.tiles--brands .tile__media { aspect-ratio: 1; }
.tile__country {
  margin-left: var(--space-1); padding: 0 0.35em; border: 1px solid var(--line); border-radius: 3px;
  font-size: 0.75rem; font-weight: 700; color: var(--muted); text-decoration: none; vertical-align: 0.2em;
  font-stretch: 100%;
}
}

/* Home page: category tiles with an icon above the name (review, 2026-12-04): the
   whole tile is the link, the count is neutral, two columns on phones. */
@layer components {
.tiles--compact {
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--space-3); margin-block: var(--space-4);
  grid-auto-rows: 1fr;
  @media (max-width: 30rem) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  & .tile__link { align-items: center; justify-content: center; text-align: center; padding: var(--space-3) var(--space-2); }
  & .tile__icon { display: grid; place-items: center; height: 3.5rem; }
  & .tile__body { padding: var(--space-2) 0 0; gap: 0.15rem; align-items: center; min-width: 0; }
  & .tile__title { font-size: 0.95rem; font-weight: 700; font-stretch: 100%; letter-spacing: 0; overflow-wrap: normal; text-wrap: balance; }
  & .tile__meta { margin-top: 0; padding-top: 0; color: var(--muted); font-weight: 500; }
}
.category-icon { width: 3.25rem; height: 3.25rem;
  & .ci-fill { fill: var(--orange); }
  & .ci-dark { fill: var(--navy); }
  & .ci-light { fill: #fff; } }
.tile--all .category-icon .ci-fill { fill: var(--line-strong, #c9cfdb); }
}

.tile__media--icon { background: var(--surface); & .category-icon { width: 5rem; height: 5rem; } }
}
