/* City Viewer — home screen ("How can we help?" hybrid, design option 2a). */

.home {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;

  /* Navy welcome header with search */
  & .home-header {
    flex: none;
    padding: calc(env(safe-area-inset-top, 0px) + var(--space-5)) var(--space-4) var(--space-4);
    background: var(--brand);
    color: var(--ink-on-brand);

    & .home-header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: var(--space-3);
    }

    & .home-title {
      margin: 0;
      font-size: 1.45rem;
      font-weight: 700;
      line-height: 1.2;
      color: var(--ink-on-brand); /* branding styles bare h2 navy */
    }

    & .home-search {
      width: 100%;
      margin-top: var(--space-3);
      padding: var(--space-3) var(--space-4);
      font: inherit;
      font-size: .95rem;
      border: 1px solid var(--surface);
      border-radius: var(--radius-md);
      background: var(--surface);
      color: var(--ink);
      box-sizing: border-box;
      outline: none;
    }
  }

  & .home-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding-block: var(--space-4) var(--space-5);

    & > * { flex: none; }   /* sections never collapse under overflow */
  }

  & .home-empty { padding-inline: var(--space-4); color: var(--ink-muted); font-size: .9rem; }
}

/* Section heading, reused across screens */
.section-title {
  margin: 0;
  padding-inline: var(--space-4);
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-muted);
}

/* ---- Services grid --------------------------------------------------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  padding-inline: var(--space-4);

  @container app (min-width: 520px) {
    & { grid-template-columns: repeat(4, 1fr); }
  }
  @container app (min-width: 700px) {
    & { grid-template-columns: repeat(6, 1fr); }
  }

  & .service-tile {
    min-height: var(--tap-min);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-1);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    font: inherit;
    font-size: .7rem;
    font-weight: 600;
    color: var(--brand);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-standard);

    &:active { background: color-mix(in oklab, var(--brand) 8%, var(--surface)); }
    & svg { width: 1.15rem; height: 1.15rem; }
  }
}

/* "Preview" pill on an unpublished menu item / report issue — rendered only for @auburnal.gov staff
   (see city.js previewBadge). Corner-anchored so it doesn't disturb the tile/row layout. */
.service-tile,
.service-link { position: relative; }
.preview-badge {
  position: absolute;
  top: var(--space-1);
  inset-inline-end: var(--space-1);
  z-index: 1;
  padding: .15em .45em;
  border-radius: 999px;
  background: var(--accent-orange, #b45309);
  color: #fff;
  font-size: .5rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ---- Places: horizontal scroll of cards ------------------------------ */
.place-scroll {
  display: flex;
  gap: var(--space-3);
  padding-inline: var(--space-4);
  overflow-x: auto;

  /* Wide: stop scrolling, wrap into a grid */
  @container app (min-width: 700px) {
    & { flex-wrap: wrap; overflow: visible; }
  }

  & .place-card {
    display: flex;
    flex-direction: column;
    flex: none;
    width: 150px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    font: inherit;
    text-align: left;
    text-decoration: none;

    & .place-photo {
      display: block;
      height: 66px;
      background: linear-gradient(135deg, #dfe5ee, #c9d3e3) center/cover no-repeat;
    }

    & .place-name {
      display: flex;
      flex-direction: column;
      gap: var(--space-1);
      padding: var(--space-2) var(--space-3) var(--space-3);
      font-size: .8rem;
      font-weight: 700;
      color: var(--ink);
    }

    & .place-status { font-size: .7rem; font-weight: 600; color: var(--success); }
    & .place-status.is-closed { color: var(--ink-muted); }
    /* Freeform hours we can't classify as open/closed render as neutral info */
    & .place-status.is-info { color: var(--ink-muted); }
  }
}

/* ---- Service link rows (also used on the Services screen) ----------- */
.service-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-inline: var(--space-4);
}

.service-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap-min);
  padding: var(--space-3) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;

  & svg { width: 1.15rem; height: 1.15rem; color: var(--brand); flex: none; }

  /* Honest labeling for link-out services */
  & .external-tag {
    margin-left: auto;
    font-size: .7rem;
    font-weight: 700;
    color: var(--ink-muted);
    white-space: nowrap;
  }
}
