:root {
  --sage: #a9b7a2;
  --sage-dark: #7f9178;
  --cream: #f7f4ee;
  --paper: #fffdf9;
  --ink: #2f2a26;
  --muted: #7b746d;
  --line: rgba(47, 42, 38, 0.12);
  --nav: #2f2925;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
  max-width: 720px;
  margin: 0 auto;
  background: var(--paper);
}

/* Header */

.topbar {
  background: var(--sage);
  color: white;
}

.topbar-inner {
  min-height: 92px;
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  align-items: end;
  padding: 18px 20px 16px;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
}

.logo-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #24211f;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.church-logo {
  width: 30px;
  height: 16px;
  object-fit: contain;
  display: block;
}

.topbar-title {
  margin: 0;
  text-align: center;
  font-size: 25px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Main */

.directory-page {
  padding: 26px 20px 40px;
}

/* Search */

.search-section {
  margin-bottom: 30px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f1efec;
  border-radius: 16px;
  padding: 0 16px;
  min-height: 58px;
}

.search-icon {
  font-size: 21px;
  opacity: 0.55;
}

.search-box input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
}

.search-box input::placeholder {
  color: #aaa49e;
}

/* Directory grid */

.directory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
  row-gap: 34px;
}

.directory-item {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
}

.directory-photo {
  width: min(34vw, 180px);
  height: min(34vw, 180px);
  max-width: 180px;
  max-height: 180px;
  min-width: 120px;
  min-height: 120px;
  margin: 0 auto 14px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #ece8e3;
  color: #9b958f;
  font-size: 44px;
  font-weight: 300;
}

.placeholder-photo {
  background:
    radial-gradient(
      circle at 35% 30%,
      #f5f2ee,
      #e9e5df 70%
    );
}

.directory-name {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 5px;
}

.directory-location {
  font-size: 15px;
  line-height: 1.3;
  color: var(--muted);
}

/* Desktop */

@media (min-width: 760px) {
  body {
    padding: 32px 0;
  }

  .app-shell {
    min-height: calc(100vh - 64px);
    border-radius: 28px;
    overflow: hidden;
    box-shadow:
      0 18px 60px rgba(47, 42, 38, 0.12);
  }

  .bottom-nav {
    bottom: 32px;
    border-radius: 0 0 28px 28px;
  }

  .directory-page {
    padding-left: 42px;
    padding-right: 42px;
  }

  .directory-grid {
    column-gap: 44px;
  }
}

/* Small phones */

@media (max-width: 420px) {
  .topbar-inner {
    min-height: 82px;
    grid-template-columns: 54px 1fr 54px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .logo-circle {
  width: 38px;
  height: 38px;
}

.church-logo {
  width: 27px;
  height: 14px;
}

  .topbar-title {
    font-size: 23px;
  }

  .directory-page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .directory-grid {
    column-gap: 18px;
    row-gap: 30px;
  }

  .directory-photo {
    min-width: 118px;
    min-height: 118px;
  }

  .directory-name {
    font-size: 17px;
  }

  .directory-location {
    font-size: 14px;
  }
}