/* Public site shell — sticky header, hero, hamburger, footer */

body.public-site {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, #ffffff 0%, var(--bg) 28%, var(--bg) 100%);
}

/* —— Sticky header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.site-brand:hover {
  color: var(--ink);
}

.site-brand__crest {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.site-brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.site-brand__name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.site-brand__sub {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.site-nav {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem;
  max-width: min(720px, 70vw);
}

.site-nav a {
  position: relative;
  padding: 0.4rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.2rem;
  height: 2px;
  background: var(--crimson);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--crimson);
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.nav-toggle[aria-expanded='true'] {
  border-color: var(--crimson);
  color: var(--crimson);
}

/* Mobile drawer */
.nav-drawer {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 99;
  background: rgba(10, 10, 10, 0.35);
}

.nav-drawer.is-open {
  display: block;
}

.nav-drawer__panel {
  margin-left: auto;
  width: min(320px, 88vw);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  animation: drawerIn 0.22s ease;
}

@keyframes drawerIn {
  from { transform: translateX(12px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.nav-drawer__panel a {
  display: block;
  padding: 0.9rem 0.75rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.nav-drawer__panel a.is-active {
  color: var(--crimson);
}

@media (min-width: 860px) {
  .site-nav { display: flex; }
  .nav-toggle { display: none; }
  .nav-drawer { display: none !important; }
  .site-brand__sub { max-width: none; }
}

/* —— Hero —— */
.hero {
  position: relative;
  width: 100%;
  padding: clamp(2.5rem, 8vw, 5rem) 1.25rem clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.hero__crest {
  width: min(200px, 42vw);
  height: auto;
  margin: 0 auto 1.5rem;
  display: block;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 4vw, 2.45rem);
  font-weight: 600;
  line-height: 1.3;
  max-width: 22ch;
  margin: 0 auto 0.75rem;
  color: var(--ink);
  font-optical-sizing: auto;
}

.hero__subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-style: italic;
  font-weight: 500;
  color: var(--muted);
  margin: 0 auto 0.5rem;
  max-width: 36ch;
  line-height: 1.4;
}

.hero__patronage {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 auto 1.75rem;
  max-width: 40ch;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.hero__cta .btn {
  min-width: 10rem;
}

.hero__cta .btn-ghost {
  background: transparent !important;
  color: var(--crimson) !important;
  border: 1px solid var(--crimson) !important;
}

.hero__cta .btn-ghost:hover {
  background: rgba(139, 0, 0, 0.06) !important;
}

@media (max-width: 520px) {
  .hero__cta {
    flex-direction: column;
    align-items: stretch;
  }
  .hero__cta .btn {
    width: 100%;
  }
}

/* Reveal motion */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* —— Main content —— */
.public-main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--space-lg) 1.25rem 3rem;
}

.public-main .home-content,
.public-main .about-content,
.public-main .leadership-content,
.public-main .contact-content {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0;
}

.public-main .rich-text {
  font-size: 1.05rem;
  color: var(--ink);
}

.public-main .rich-text h1,
.public-main .rich-text h2,
.public-main .rich-text h3 {
  font-family: var(--font-display);
  color: var(--ink);
  border-bottom-color: var(--line);
}

.public-main .rich-text h1 {
  border-bottom: 2px solid var(--crimson);
}

.public-main .rich-text a {
  color: var(--crimson);
}

.page-header-simple {
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.page-header-simple h1 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0;
}

/* —— Archive / library —— */
.public-main .archive-article {
  line-height: 1.7;
  max-width: 42rem;
}

.public-main .archive-article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.25rem auto;
}

.public-main .archive-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.public-main .archive-article td,
.public-main .archive-article th {
  border: 1px solid var(--line);
  padding: 0.4rem 0.6rem;
  vertical-align: top;
}

.public-main .archive-source {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}

.public-main .archive-source a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.public-main .archive-source a:hover {
  color: var(--crimson);
}

.library-index {
  margin-top: 2rem;
}

.library-index__heading {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 1rem;
  color: var(--ink);
}

.library-index__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem 1.5rem;
}

@media (min-width: 640px) {
  .library-index__list {
    grid-template-columns: 1fr 1fr;
  }
}

.library-index__list li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}

.library-index__list a {
  color: var(--ink);
  text-decoration: none;
  flex: 1;
  line-height: 1.35;
}

.library-index__list a:hover {
  color: var(--crimson);
}

.library-index__hint {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.75rem 1.25rem 2rem;
  text-align: center;
  background: var(--surface);
}

.site-footer__meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.site-footer__meta a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer__meta a:hover {
  color: var(--crimson);
}

.site-footer__motto {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--ink);
  margin: 0;
  line-height: 1.45;
  max-width: 36rem;
  margin-inline: auto;
}

/* Legacy public header/nav hidden when using new shell */
body.public-site > header:not(.site-header),
body.public-site > nav.main-menu {
  display: none;
}
