@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

/* ── Variables ─────────────────────────────────── */
:root {
  --sidebar-bg:   #7a1018;
  --sidebar-dark: #5e0c12;
  --gold:         #c9a84c;
  --gold-bright:  #e8c96a;
  --gold-dim:     #9a7a32;
  --content-bg:   #faf7f0;
  --text-main:    #1e120a;
  --text-sub:     #4a3525;
  --border:       #d8c9a8;
  --link-color:   #7a1018;
  --nav-w:        230px;
  --header-h:     115px;
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Lora', Georgia, serif;
  color: var(--text-main);
  min-height: 100vh;
}

html, body {
  height: 100%;
  overflow: hidden;  /* add this */
}

/* ── Page shell ─────────────────────────────────── */
#page-wrapper {
  max-width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
  height: 100vh;
  overflow: hidden;
}

/* ── Header ─────────────────────────────────────── */
#site-header {
  background: var(--sidebar-bg);
  border-bottom: 3px solid var(--gold);
  display: flex;
  align-items: center;
  min-height: var(--header-h);
  padding: 10px 16px;
  gap: 14px;
}

#site-header .header-crest {
  flex-shrink: 0;
  height: 88px;
  width: 88px;
  object-fit: contain;
}

#site-header .header-title {
  flex: 1;
  text-align: center;
}

#site-header .header-title h1 {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold-bright);
  line-height: 1.4;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

#site-header .header-title .subtitle {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  color: var(--gold);
  margin-top: 4px;
}

#site-header .header-church-photo {
  flex-shrink: 0;
  height: 88px;
  width: 120px;
  object-fit: cover;
  border: 2px solid var(--gold-dim);
}

/* ── Body layout ─────────────────────────────────── */
#body-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#right-sidebar {
  width: 350px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-dark) 100%);
  border-left: 2px solid var(--gold-dim);
  padding: 18px 14px;
  font-size: 0.82rem;
  color: var(--gold);
  overflow-y: auto;
}

#right-sidebar h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--gold-bright);
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 6px;
  margin-bottom: 10px;
}

#right-sidebar p, #right-sidebar li {
  color: var(--gold-dim);
  line-height: 1.7;
  font-size: 0.8rem;
}

/* Hide on mobile */
@media (max-width: 800px) {
  #right-sidebar { display: none; }
}

/* ── Sidebar nav ─────────────────────────────────── */
#site-nav {
  width: var(--nav-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-dark) 100%);
  border-right: 2px solid var(--gold-dim);
  padding: 18px 0 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

#site-nav ul {
  list-style: none;
  flex: 1;
}

#site-nav ul li a {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 9px 16px 9px 14px;
  text-decoration: none;
  font-family: 'Lora', serif;
  font-size: 0.92rem;
  color: var(--gold);
  line-height: 1.35;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

#site-nav ul li a:hover,
#site-nav ul li a.active {
  background: rgba(255,255,255,0.08);
  color: var(--gold-bright);
  border-left-color: var(--gold);
}

#site-nav ul li a .nav-cross {
  display: inline-block;
  width: 15px;
  height: 15px;
  background-image: url('../images/kors.gif');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  font-size: 0; /* hides the ✛ character */
  flex-shrink: 0;
  margin-top: 2px;
}

/* Language flags in nav */
#site-nav .lang-flags {
  display: flex;
  gap: 10px;
  padding: 16px 12px 4px;
  justify-content: flex-start;
}

#site-nav .lang-flags img {
  width: 34px;
  height: 22px;
  object-fit: cover;
  border: 1px solid var(--gold-dim);
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s;
}

#site-nav .lang-flags img:hover { opacity: 1; }

/* ── Main content ─────────────────────────────────── */
#main-content {
  flex: 1;
  background: var(--content-bg);
  padding: 28px 30px 40px;
  min-height: 500px;
  overflow-y: auto;
}

/* Page heading with cross */
.page-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.page-heading .heading-cross {
  display: inline-block;
  width: 40px;
  height: 40px;
  background-image: url('../images/cross-orth-tiny.gif');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.page-heading h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--sidebar-bg);
}

/* Content placeholder style */
.content-placeholder {
  color: #aaa;
  font-style: italic;
  padding: 30px 0;
  font-size: 0.9rem;
}

/* ── Footer ─────────────────────────────────────── */
#site-footer {
  background: var(--sidebar-dark);
  border-top: 2px solid var(--gold-dim);
  padding: 14px 20px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--gold-dim);
  line-height: 1.8;
}

#site-footer a {
  color: var(--gold);
  text-decoration: none;
}

#site-footer a:hover { text-decoration: underline; }

/* ── Typography helpers ──────────────────────────── */
p { line-height: 1.75; margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

h3 {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--sidebar-bg);
  margin: 1.4em 0 0.5em;
}

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

/* Schedule table */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 8px;
}

.schedule-table th {
  background: var(--sidebar-bg);
  color: var(--gold);
  padding: 8px 10px;
  font-family: 'Cinzel', serif;
  font-weight: 400;
  text-align: left;
  font-size: 0.8rem;
}

.schedule-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.schedule-table tr:nth-child(even) td { background: var(--content-bg); }
.schedule-table tr:nth-child(odd)  td { background: #fff; }

.schedule-month {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--sidebar-bg);
  margin: 1.6em 0 0.4em;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

/* Gallery / timeline */
.gallery-event {
  border-bottom: 1px solid var(--border);
}

.gallery-event-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 6px;
  cursor: pointer;
  transition: background 0.12s;
}

.gallery-event-header:hover { background: #f0ead8; }

.gallery-event-date {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  color: var(--text-sub);
  min-width: 90px;
}

.gallery-event-name {
  font-size: 0.92rem;
  color: var(--text-main);
  flex: 1;
}

.gallery-event-arrow {
  color: var(--gold-dim);
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.gallery-event.open .gallery-event-arrow { transform: rotate(90deg); }

.gallery-event-body {
  display: none;
  padding: 12px 16px 16px;
  background: #f5f0e4;
  font-size: 0.88rem;
  color: var(--text-sub);
}

.gallery-event.open .gallery-event-body { display: block; }

/* Donors table */
.donors-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  margin-top: 8px;
}

.donors-table th {
  background: var(--sidebar-bg);
  color: var(--gold);
  padding: 7px 10px;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  text-align: left;
  font-size: 0.85rem;
}

.donors-table td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--border);
}

.donors-table tr:nth-child(even) td { background: #fff; }
.donors-table tr:nth-child(odd)  td { background: var(--content-bg); }

/* Names list */
.names-grid {
  columns: 3;
  column-gap: 20px;
  font-size: 0.85rem;
  line-height: 1.9;
}

@media (max-width: 700px) {
  .names-grid { columns: 2; }
}

.names-letter {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--sidebar-bg);
  font-weight: 700;
  break-after: avoid;
  margin-top: 0.5em;
}

/* Contact info block */
.contact-block {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 0.9rem;
  line-height: 1.9;
}

.contact-block strong { color: var(--sidebar-bg); }

/* Info box */
.info-box {
  background: #fff8ec;
  border: 1px solid var(--gold-dim);
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 0.88rem;
  line-height: 1.75;
}

/* Two-column image + text layout */
.two-col {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 1.2em;
}

.two-col img {
  max-width: 220px;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

/* Prayer section */
.prayer-section {
  margin-bottom: 2em;
  padding-bottom: 1em;
  border-bottom: 1px dashed var(--border);
}

.prayer-section h3 { margin-top: 0; }

.prayer-toc {
  background: #fff;
  border: 1px solid var(--border);
  padding: 14px 20px;
  margin-bottom: 1.5em;
  font-size: 0.85rem;
  line-height: 2;
  columns: 2;
}

.prayer-toc a { color: var(--link-color); }

/* ═══════════════════════════════════════════════════
   MOBILE / RESPONSIVE
   ═══════════════════════════════════════════════════ */

/* ── Hamburger button (hidden on desktop) ─────────── */
#nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

#nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

/* Animate to X when open */
#nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#nav-toggle.open span:nth-child(2) { opacity: 0; }
#nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Tablet (≤ 800px) ─────────────────────────────── */
@media (max-width: 800px) {
  #site-header {
    padding: 8px 12px;
    gap: 10px;
    min-height: auto;
  }

  #site-header .header-crest        { height: 64px; width: 64px; }
  #site-header .header-church-photo { height: 64px; width: 88px; }

  #site-header .header-title h1     { font-size: 1.05rem; }
  #site-header .header-title .subtitle { font-size: 0.85rem; }
}

/* ── Mobile (≤ 600px) ─────────────────────────────── */
@media (max-width: 600px) {

  /* Show hamburger, hide nothing else yet */
  #nav-toggle { display: flex; }

  /* Header: crest + title + hamburger, no church photo */
  #site-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    position: relative;
  }

  #site-header .header-church-photo { display: none; }

  #site-header .header-title h1     { font-size: 0.95rem; }
  #site-header .header-title .subtitle { font-size: 0.78rem; }
  #site-header .header-crest        { height: 52px; width: 52px; }

  /* Body layout becomes vertical */
  #body-layout { flex-direction: column; }

  /* Nav slides in from the left as an overlay */
  #site-nav {
    width: 100%;
    border-right: none;
    border-bottom: 2px solid var(--gold-dim);
    padding: 8px 0 16px;

    /* Hidden by default */
    display: none;
    overflow: hidden;
  }

  #site-nav.nav-open { display: flex; }

  /* Slightly bigger tap targets on mobile */
  #site-nav ul li a {
    padding: 11px 16px;
    font-size: 0.95rem;
  }

  #site-nav .lang-flags {
    padding: 12px 16px 4px;
    gap: 14px;
  }

  #site-nav .lang-flags img { width: 38px; height: 24px; }

  /* Content fills full width */
  #main-content {
    padding: 20px 16px 32px;
  }

  /* Page heading smaller */
  .page-heading h2 { font-size: 1.2rem; }

  /* Two-column layout stacks */
  .two-col {
    flex-direction: column;
  }

  .two-col img { max-width: 100%; }

  /* Names grid: 1 column on small screens */
  .names-grid { columns: 1; }

  /* Schedule table: allow horizontal scroll */
  .schedule-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Footer wraps */
  #site-footer {
    font-size: 0.72rem;
    padding: 12px 14px;
    line-height: 2;
  }

  /* Gallery events: more padding for touch */
  .gallery-event-header { padding: 12px 8px; }
}
