:root {
  --bg: #f7f4ef;
  --surface: #fff;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --accent: #1e4d3a;
  --accent-light: #2d6b4f;
  --border: #e0d9ce;
  --shadow: 0 4px 24px rgba(30, 77, 58, 0.08);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-light);
  text-decoration: underline;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  font-weight: 500;
}

.nav-admin {
  opacity: 0.7;
  font-size: 0.9rem;
}

.hero,
.page-header,
.member-hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}

.hero h1,
.page-header h1,
.member-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--accent);
}

.tagline {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 36rem;
}

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.section h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.member-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.member-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  display: block;
}

.member-avatar.placeholder {
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 2.5rem;
  line-height: 96px;
  text-align: center;
}

.member-card h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.role {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.25rem 0;
}

.subdomain-link {
  font-size: 0.85rem;
}

.family-tree {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tree-children {
  list-style: none;
  padding-left: 2rem;
  margin-top: 0.75rem;
  border-left: 2px solid var(--border);
}

.tree-node {
  margin-bottom: 1rem;
}

.tree-card,
.tree-spouse {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  background: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tree-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.tree-role {
  color: var(--muted);
  font-size: 0.9rem;
}

.tree-sub {
  font-size: 0.8rem;
  color: var(--accent-light);
}

.tree-connector {
  color: var(--muted);
  margin: 0 0.5rem;
}

.tree-spouse {
  margin-top: 0.5rem;
  margin-left: 1rem;
}

.member-hero {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.member-hero-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
}

.member-hero-avatar.placeholder.large {
  width: 160px;
  height: 160px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 160px;
  text-align: center;
  border-radius: 50%;
}

.subdomain-badge {
  font-size: 0.95rem;
  color: var(--muted);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
}

.gallery figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.news-item {
  background: var(--surface);
  padding: 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.news-item time {
  font-size: 0.85rem;
  color: var(--muted);
}

.video-list {
  display: grid;
  gap: 1.5rem;
}

.video-item video {
  max-width: 100%;
  border-radius: 8px;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none !important;
}

.btn:hover {
  background: var(--accent-light);
}

.btn--small {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
}

.btn--danger {
  background: #8b2e2e;
}

.center {
  text-align: center;
  margin-top: 2rem;
}

.subdomain-list {
  list-style: none;
  padding: 0;
}

.subdomain-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.site-footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

.admin-login {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-form {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 400px;
}

.login-form label {
  display: block;
  margin-bottom: 1rem;
}

.login-form input {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.admin-form label {
  display: block;
  margin-bottom: 1rem;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  max-width: 500px;
  padding: 0.6rem;
  margin-top: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.admin-member-list,
.admin-item-list {
  list-style: none;
  padding: 0;
}

.admin-member-list li,
.admin-item-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

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

.error {
  color: #8b2e2e;
}

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

@media (max-width: 600px) {
  .nav {
    flex-direction: column;
    gap: 1rem;
  }

  .tree-children {
    padding-left: 1rem;
  }
}
