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

:root {
  --bg: #1b2232;
  --surface: #252f45;
  --text: #e2dfd8;
  --muted: #b9b8b4;
  --accent: #d4af37;
  --accent-dark: #c59b27;
  --border: #8a733b;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  --radius: 10px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #1b2232 0%, #1e2638 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(960px, 100% - 2rem);
  margin-inline: auto;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

main {
  flex: 1;
  padding: 1.5rem 0 3rem;
}

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  text-align: center;
  color: var(--muted);
}

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

.intro-text {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.menu-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.person-search {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.person-search h2 {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 1.25rem;
}

.person-search label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.person-search input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  background: var(--bg);
  font: inherit;
}

.person-search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.person-search-status {
  min-height: 1.6rem;
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.person-search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.person-search-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s, border-color 0.2s;
}

.person-search-result:hover,
.person-search-result:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  outline: none;
}

.person-search-result img {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.person-search-result-name {
  font-weight: 600;
}

.person-search-result-parent {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.menu-card {
  display: block;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.menu-card:hover,
.menu-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
  border-color: var(--accent);
  outline: none;
}

.menu-card-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 0.75rem;
}

.menu-card-icon img {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid var(--accent);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.menu-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: var(--accent);
}

.menu-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.page-content {
  padding-top: 0.5rem;
}

.history-article {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.history-article h1 {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 1.75rem;
}

.history-lead {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.history-body p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.event-article {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.event-article h1 {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 1.75rem;
}

.event-description {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.event-gallery-status {
  color: var(--muted);
  margin: 0 0 1rem;
}

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

.event-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
}

.media-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.media-image-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.media-article {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.media-article h1 {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 1.75rem;
}

.media-status {
  color: var(--muted);
  margin: 0 0 1rem;
}

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

.media-item {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.media-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.media-item figcaption {
  padding: 0.6rem 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.people-article {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.people-article h1 {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 1.75rem;
}

.people-status {
  color: var(--muted);
  margin: 0 0 1rem;
}

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

.person-directory-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s, border-color 0.2s;
}

.person-directory-card:hover,
.person-directory-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  outline: none;
}

.person-directory-card img {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.person-directory-name,
.person-directory-detail {
  display: block;
  overflow-wrap: anywhere;
}

.person-directory-name {
  color: var(--accent);
  font-weight: 700;
}

.person-directory-detail {
  color: var(--muted);
  font-size: 0.9rem;
}

.btn-primary {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
  transition: background 0.2s;
}

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

.ancestor-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.ancestor-breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.ancestor-breadcrumb a:hover {
  text-decoration: underline;
}

.ancestor-breadcrumb .sep {
  color: var(--muted);
  user-select: none;
}

.ancestor-breadcrumb .current {
  font-weight: 700;
  color: var(--text);
}

.person-detail {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.person-card-inner {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.person-photo {
  width: 140px;
  height: 140px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--bg);
  border: 2px solid var(--border);
}

.person-photo-button {
  display: block;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  cursor: zoom-in;
}

.person-photo-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.lightbox-open {
  overflow: hidden;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 3rem 1.5rem 1.5rem;
  background: rgba(10, 14, 24, 0.92);
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox img {
  display: block;
  max-width: min(100%, 900px);
  max-height: calc(100vh - 4rem);
  object-fit: contain;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.image-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

.image-lightbox-close:hover,
.image-lightbox-close:focus-visible {
  background: var(--accent);
  color: var(--bg);
  outline: none;
}

.person-info h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  color: var(--accent);
}

.person-fullname {
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.person-meta {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.person-meta dt {
  font-weight: 600;
  display: inline;
}

.person-meta dt::after {
  content: ": ";
}

.person-meta dd {
  display: inline;
  margin: 0;
  color: var(--muted);
}

.person-meta div {
  margin: 0;
}

.person-description {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
}

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

.person-phone a:hover {
  text-decoration: underline;
}

.contact-links,
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.contact-links a,
.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  color: var(--accent);
  font-size: 0.85rem;
  text-decoration: none;
}

.contact-links a:hover,
.social-links a:hover {
  border-color: var(--accent);
  background: var(--bg);
}

.sons-section h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  color: var(--accent);
}

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

.son-card {
  display: block;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
}

.son-card:hover,
.son-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  outline: none;
}

.son-card img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.5rem;
  border: 2px solid var(--border);
}

.son-card span {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.loading,
.error {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

.error {
  color: #f0a0a0;
}

@media (max-width: 600px) {
  main {
    padding-top: 1rem;
    padding-bottom: 2rem;
  }

  .container {
    width: min(100% - 1.25rem, 960px);
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .logo {
    width: 40px;
    height: 40px;
  }

  .person-card-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .person-photo {
    margin: 0 auto;
  }

  .history-article {
    padding: 1.25rem 1rem;
  }

  .history-article h1,
  .event-article h1 {
    font-size: 1.4rem;
  }

  .event-article,
  .person-detail,
  .media-article,
  .people-article {
    padding: 1.25rem 1rem;
  }

  .event-gallery {
    grid-template-columns: 1fr;
  }

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

  .people-grid {
    grid-template-columns: 1fr;
  }

  .person-search {
    padding: 1.25rem 1rem;
  }

  .contact-links,
  .social-links {
    justify-content: center;
  }

  .sons-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
