/* ---------- Theme tokens (light) ---------- */
.ha-bento-grid {
  --ink: #0f172a;

  --tile-bg: #ffffff;    /* can be overridden per tile via inline style */
  --tile-ink: #0f172a;   /* can be overridden per tile via inline style */

  --tile-radius: 14px;
  --tile-pad: 24px;
}

.ha-bento-grid {
  padding-top: 100px;
}

.ha-bento-grid__header {
  text-align: center;
  margin: 0 auto 32px;
  max-width: 900px;
}
.ha-bento-grid__header h2 {
  font-size: clamp(24px, 3vw, 36px);
  line-height: clamp(32px, 4vw, 40px);
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--tile-ink);
}
.ha-bento-grid__header p {
  margin: 0;
  color: var(--tile-ink);
  font-size: clamp(14px, 2vw, 18px);
  line-height: clamp(20px, 2.5vw, 28px);
  font-weight: 400;
}

/* ---------- Grid layout ---------- */
.ha-bento-grid__wrapper {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr 1fr 1fr;
  grid-auto-rows: 1fr;
  grid-auto-flow: row dense; /* tight packing like the mockup */
}

/* Base tile */
.ha-bento-grid__item {
  background: var(--tile-bg);
  color: var(--tile-ink);
  border-radius: var(--tile-radius);
  padding: var(--tile-pad);
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 300px; /* safety; content can grow */
  box-shadow: 0 1px 0 rgba(15,23,42,.03), 0 8px 24px rgba(15,23,42,.06);
}

/* Hero tile spans two columns and two rows on desktop */
.ha-bento-grid__item:nth-child(1) {
  grid-column: 1 / span 2;
  grid-row: 1 / span 1;
  background-color: var(--heise-light-blue-600);
  color: #fff;
}

.ha-bento-grid__item:nth-child(1) .blue-tile-text {
  font-size: clamp(30px, 3vw, 60px);
  line-height: clamp(36px, 4vw, 72px);
  font-weight: 700;
  margin: 0 0 20px;
}
.ha-bento-grid__item:nth-child(1) p {
  font-size: 16px;
  line-height: 24px;
}

/* Placement for classic 5-tile layout */
.ha-bento-grid__item:nth-child(2) { /* Tile 2 (right, top)   */
  grid-column: 3;
  grid-row: 1;
}
.ha-bento-grid__item:nth-child(3) { /* Tile 3 (right, middle) */
  grid-column: 1;
  grid-row: 2;
}
.ha-bento-grid__item:nth-child(4) { /* Tile 4 (under hero, left)  */
  grid-column: 2;
  grid-row: 2;
}
.ha-bento-grid__item:nth-child(5) { /* Tile 5 (under hero, middle)*/
  grid-column: 3;
  grid-row: 2;
}

/* Content */
.ha-bento-grid__icon img { height: 150px; width: auto; margin-bottom: 12px; }
.ha-bento-grid__content .blue-tile-text { 
  font-size: clamp(20px, 2.3vw, 24px); 
  line-height: clamp(28px, 3vw, 32px);
  font-weight: 600; 
}
.ha-bento-grid__content p { 
  margin: 0; 
  font-size: clamp(14px, 2vw, 16px); 
  line-height: clamp(20px, 2.5vw, 24px);
}

/* ---------- Mobile layout (matches your right-side mockup) ---------- */
@media (max-width: 481px) {
  .ha-bento-grid { padding: 40px 20px 0 20px; }

  .ha-bento-grid__wrapper {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    justify-content: center;
    gap: 20px;
  }
  .ha-bento-grid__header {
    margin: 0 auto 16px;
  }
  .ha-bento-grid__item,
  /* .ha-bento-grid__item.is-large, */
  .ha-bento-grid__item:nth-child(1),
  .ha-bento-grid__item:nth-child(2),
  .ha-bento-grid__item:nth-child(3),
  .ha-bento-grid__item:nth-child(4),
  .ha-bento-grid__item:nth-child(5) {
    grid-column: auto;
    grid-row: auto;
    /* max-height: 200px; */
    height: fit-content;
    width: 100%;
  }
  .ha-bento-grid__icon img { height: 100px;, margin-bottom: 4px; }
}

/* Dark mode styles */
.dark .ha-bento-grid {
  --tile-bg: var(--ui-slate-700);
  --tile-ink: #ffffff;
}

/* Tablet View */
@media (max-width: 1024px) {
  .ha-bento-grid {
    padding-left: 20px;
    padding-right: 20px;
  }
}