:root {
  color-scheme: light;
  --ink: #17211d;
  --ink-2: #283730;
  --muted: #65716c;
  --faint: #8a9691;
  --line: #dce4de;
  --line-strong: #c5d0c8;
  --paper: #f6f7f2;
  --surface: #ffffff;
  --soft: #edf3ee;
  --brand: #28624e;
  --brand-dark: #174635;
  --brand-soft: #dcece2;
  --accent: #b86436;
  --accent-soft: #fff0e5;
  --danger: #9d2f2f;
  --success: #267044;
  --shadow: 0 18px 48px rgba(30, 47, 39, .10);
  --shadow-soft: 0 8px 24px rgba(30, 47, 39, .08);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(40, 98, 78, .11), transparent 330px),
    linear-gradient(180deg, #fbfcf8 0, var(--paper) 380px);
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 33, 29, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 29, .035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .65), transparent 62%);
}

a {
  color: var(--brand-dark);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

button,
.button,
input,
select,
textarea {
  font: inherit;
}

button,
.button {
  appearance: none;
  border: 0;
  border-radius: 7px;
  background: var(--brand);
  color: white;
  min-height: 42px;
  padding: 10px 16px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(40, 98, 78, .18);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

button:hover,
.button:hover {
  background: var(--brand-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(40, 98, 78, .22);
}

.button.secondary {
  background: var(--ink);
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 52px);
  background: rgba(255, 255, 255, .86);
  border-bottom: 1px solid rgba(220, 228, 222, .88);
  backdrop-filter: blur(14px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  margin-top: 28px;
}

.brand {
  color: var(--ink);
  font-weight: 900;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand::before {
  content: "";
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .2), transparent),
    var(--brand);
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, .18);
}

.brand:has(.brand-logo)::before {
  display: none;
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 7px;
  background: white;
  border: 1px solid var(--line);
  padding: 3px;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

nav a,
.inline-form button {
  color: var(--ink-2);
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 14px;
  font-weight: 750;
}

nav a:hover,
.inline-form button:hover {
  background: var(--soft);
  text-decoration: none;
}

.inline-form {
  display: inline;
}

.inline-form button {
  background: transparent;
  min-height: auto;
  box-shadow: none;
}

main {
  min-height: calc(100vh - 150px);
}

.hero {
  width: min(var(--max), calc(100% - 36px));
  min-height: 460px;
  margin: 24px auto 0;
  display: flex;
  align-items: center;
  padding: clamp(30px, 6vw, 76px);
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(19, 34, 29, .86), rgba(19, 34, 29, .42) 55%, rgba(19, 34, 29, .08)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='780' viewBox='0 0 1400 780'%3E%3Crect width='1400' height='780' fill='%2382a593'/%3E%3Cpath d='M0 590 C160 505 260 650 440 535 C595 436 725 498 870 390 C1030 270 1160 340 1400 210 L1400 780 L0 780 Z' fill='%23e3eadf'/%3E%3Cpath d='M760 178 h290 v365 h-290z' fill='%23fbfcf8'/%3E%3Cpath d='M802 236 h196 v36 h-196zM802 304 h196 v36 h-196zM802 372 h142 v36 h-142z' fill='%2328624e'/%3E%3Cpath d='M278 270 h288 v273 h-288z' fill='%23fff8ee'/%3E%3Cpath d='M322 338 h184 v34 h-184zM322 404 h142 v34 h-142z' fill='%23b86436'/%3E%3Ccircle cx='1120' cy='210' r='58' fill='%23f7c97c' opacity='.9'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  color: white;
  box-shadow: var(--shadow);
}

.hero > div {
  max-width: 760px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: 0;
  margin-bottom: 22px;
}

h2 {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  font-size: 21px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.hero p:not(.eyebrow),
.page-title p,
.section-heading p {
  color: var(--muted);
  max-width: 680px;
}

.hero p:not(.eyebrow) {
  color: rgba(255, 255, 255, .84);
}

.eyebrow {
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .08em;
  margin-bottom: 10px;
}

.hero .eyebrow {
  color: #ffd4ab;
}

.search-panel {
  display: flex;
  gap: 10px;
  max-width: 680px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-soft);
}

.search-panel input,
.card-form input,
.card-form select,
.card-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.search-panel input {
  border-color: transparent;
  min-height: 44px;
}

.search-panel input:focus,
.card-form input:focus,
.card-form select:focus,
.card-form textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(40, 98, 78, .12);
}

.search-panel.compact {
  max-width: 560px;
  border: 1px solid var(--line);
}

.section,
.page-title,
.form-page {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(32px, 5vw, 62px) 0;
}

.page-title {
  padding-bottom: 24px;
}

.page-title h1 {
  color: var(--ink);
  margin-bottom: 10px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.church-card,
.business-card,
.panel,
.card-form,
.profile-main {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.church-card {
  display: grid;
  gap: 7px;
  min-height: 126px;
  padding: 20px;
  color: var(--ink);
  position: relative;
  overflow: hidden;
}

.church-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -30px;
  width: 92px;
  height: 92px;
  border-radius: 28px;
  background: var(--brand-soft);
  transform: rotate(18deg);
}

.church-card strong,
.church-card span {
  position: relative;
  z-index: 1;
}

.church-card strong {
  font-size: 20px;
}

.church-card span,
.muted {
  color: var(--muted);
}

.directory-layout,
.profile,
.dashboard-grid {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(250px, 320px) 1fr;
  gap: 28px;
  padding: clamp(24px, 4vw, 42px) 0;
}

.profile {
  grid-template-columns: 1fr minmax(250px, 320px);
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.sidebar h2 {
  margin-bottom: 10px;
}

.category-nav {
  display: grid;
  align-items: stretch;
  gap: 8px;
  margin: 18px 0;
}

.category-nav a {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  background: white;
  color: var(--ink-2);
  font-weight: 750;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-nav a::after {
  content: ">";
  color: var(--accent);
  font-weight: 900;
}

.category-nav a:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  text-decoration: none;
}

.subnav {
  margin-top: 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.subnav a {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--ink-2);
  font-weight: 800;
}

.subnav a:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  text-decoration: none;
}

.directory-content {
  min-width: 0;
}

.business-list {
  display: grid;
  gap: 14px;
}

.business-card {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 260px);
  gap: 20px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.business-card::before {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 5px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
  opacity: .88;
}

.business-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  transition: transform .16s ease, border-color .16s ease;
}

.business-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.business-card dl {
  align-self: center;
  padding: 14px;
  border-radius: 7px;
  background: var(--soft);
}

dl {
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

dd {
  margin: 0 0 9px;
  color: var(--ink-2);
  font-weight: 650;
}

.verified {
  display: inline-flex;
  margin-left: 8px;
  color: var(--success);
  background: #e2f2e7;
  border-radius: 999px;
  padding: 2px 8px;
  letter-spacing: 0;
  text-transform: none;
}

.ad-slot {
  border: 1px solid #e7cbb7;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, #fff8f0, #fffdf9 62%),
    var(--accent-soft);
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  position: relative;
}

.ad-slot::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -38px;
  width: 116px;
  height: 116px;
  border-radius: 38px;
  background: rgba(184, 100, 54, .13);
  transform: rotate(24deg);
}

.top-banner {
  width: min(var(--max), calc(100% - 36px));
  margin: 22px auto 0;
  min-height: 96px;
  display: flex;
  align-items: center;
}

.top-banner a {
  grid-template-columns: 1fr;
}

.ad-slot a {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 5px;
  color: var(--ink);
}

.ad-slot strong {
  font-size: 19px;
}

.ad-slot span {
  color: var(--muted);
}

.ad-label {
  position: relative;
  z-index: 1;
  margin: 0 0 7px;
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
}

.ad-slot.empty {
  background: var(--soft);
  border-color: var(--line);
}

.form-page {
  max-width: 760px;
}

.card-form {
  display: grid;
  gap: 15px;
  padding: clamp(18px, 3vw, 28px);
}

.card-form label {
  display: grid;
  gap: 7px;
  font-weight: 800;
  color: var(--ink-2);
}

.card-form textarea {
  min-height: 130px;
  resize: vertical;
}

.card-form input[type="color"] {
  width: 76px;
  min-height: 44px;
  padding: 4px;
  cursor: pointer;
}

.card-form input[type="file"] {
  padding: 10px;
}

.checkbox-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
}

.checkbox-row input {
  width: auto;
}

.brand-preview {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, var(--brand-soft), white 58%);
  padding: 16px;
}

.brand-preview strong {
  color: var(--brand-dark);
}

.brand-preview span {
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
}

.logo-preview,
.logo-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  object-fit: contain;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 900;
}

.swatch-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.swatch-row span {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--line);
}

.error,
.success {
  padding: 12px 14px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid currentColor;
  font-weight: 750;
}

.error {
  color: var(--danger);
}

.success {
  color: var(--success);
}

.profile-main {
  padding: clamp(24px, 5vw, 48px);
}

.profile-main h1 {
  color: var(--ink);
  margin-bottom: 16px;
}

.profile-main > p {
  font-size: 18px;
  color: var(--muted);
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px 0;
}

.details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.details div {
  border-radius: 7px;
  background: var(--soft);
  padding: 13px;
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  padding: 20px;
}

.panel h2 {
  margin-bottom: 14px;
}

.panel.wide {
  grid-column: 1 / -1;
}

.approval-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
}

.admin-list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

.admin-list-row p {
  margin: 4px 0 0;
  color: var(--muted);
}

@media (max-width: 860px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-panel,
  .section-heading,
  .business-card,
  .admin-list-row,
  .directory-layout,
  .profile,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .sidebar {
    position: static;
  }

  .hero {
    min-height: 390px;
  }
}

@media (max-width: 560px) {
  .hero,
  .section,
  .page-title,
  .form-page,
  .directory-layout,
  .profile,
  .dashboard-grid,
  .top-banner {
    width: min(100% - 24px, var(--max));
  }

  .hero {
    padding: 28px 20px;
  }

  h1 {
    font-size: 38px;
  }

  nav {
    gap: 4px;
  }

  nav a,
  .inline-form button {
    padding: 7px 8px;
  }

  .search-panel {
    flex-direction: column;
  }
}
